12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- (ert-deftest ob-emacs-lisp/commented-last-block-line-no-var ()
- (org-test-with-temp-text-in-file "
- #+begin_src emacs-lisp
- ;;
- #+end_src"
- (progn
- (org-babel-next-src-block)
- (org-ctrl-c-ctrl-c)
- (should (re-search-forward "results:" nil t))
- (forward-line)
- (should
- (string=
- ""
- (buffer-substring-no-properties (point-at-bol) (point-at-eol))))))
- (org-test-with-temp-text-in-file "
- #+begin_src emacs-lisp
- \"some text\";;
- #+end_src"
- (progn
- (org-babel-next-src-block)
- (org-ctrl-c-ctrl-c)
- (should (re-search-forward "results:" nil t))
- (forward-line)
- (should
- (string=
- ": some text"
- (buffer-substring-no-properties (point-at-bol) (point-at-eol)))))))
- (ert-deftest ob-emacs-lisp/commented-last-block-line-with-var ()
- (org-test-with-temp-text-in-file "
- #+begin_src emacs-lisp :var a=1
- ;;
- #+end_src"
- (progn
- (org-babel-next-src-block)
- (org-ctrl-c-ctrl-c)
- (re-search-forward "results" nil t)
- (forward-line)
- (should (string=
- ""
- (buffer-substring-no-properties (point-at-bol) (point-at-eol))))))
- (org-test-with-temp-text-in-file "
- #+begin_src emacs-lisp :var a=2
- 2;;
- #+end_src"
- (progn
- (org-babel-next-src-block)
- (org-ctrl-c-ctrl-c)
- (re-search-forward "results" nil t)
- (forward-line)
- (should (string=
- ": 2"
- (buffer-substring-no-properties (point-at-bol) (point-at-eol)))))))
- (provide 'test-ob-emacs-lisp)
-
|