branch: elpa/evil-nerd-commenter
commit 4f83773eee9330ac610ba0d3ecf59af9f5730c79
Author: Benedikt Tissot <[email protected]>
Commit: Benedikt Tissot <[email protected]>
add test for org-land-major-mode needing org-src-lang-modes
---
evil-nerd-commenter-tests.el | 20 ++++++++++++++++++--
1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/evil-nerd-commenter-tests.el b/evil-nerd-commenter-tests.el
index c6ffb927b3..be610d8ecf 100644
--- a/evil-nerd-commenter-tests.el
+++ b/evil-nerd-commenter-tests.el
@@ -106,9 +106,9 @@
(insert "* hello\n"
"** world\n"
"#+BEGIN_SRC python\n"
- "def f():"
+ "def f():\n"
" print 'hello world'\n"
- " print 'bye wrold'\n"
+ " print 'bye world'\n"
"#+END_SRC\n")
(org-mode)
(goto-char (point-min))
@@ -116,4 +116,20 @@
(setq lang-f (evilnc--org-lang-major-mode))
(should (string= lang-f "python-mode")))))
+(ert-deftest evilnc-test-org-src-block-with-org-src-lang-modes ()
+ (let* (lang-f)
+ (with-temp-buffer
+ (insert "* hello\n"
+ "** world\n"
+ "#+BEGIN_SRC elisp\n"
+ "(defun f ()\n"
+ " (princ 'hello world')\n"
+ " (princ 'bye world'))\n"
+ "#+END_SRC\n")
+ (org-mode)
+ (goto-char (point-min))
+ (re-search-forward "(princ 'hello world'")
+ (setq lang-f (evilnc--org-lang-major-mode))
+ (should (string= lang-f "emacs-lisp-mode")))))
+
(ert-run-tests-batch-and-exit)