123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- (ert-deftest ob-emacs-lisp/commented-last-block-line-no-var ()
- (org-test-with-temp-text-in-file "
- #+begin_src emacs-lisp
- ;;
- #+end_src"
- (org-babel-next-src-block)
- (org-babel-execute-maybe)
- (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"
- (org-babel-next-src-block)
- (org-babel-execute-maybe)
- (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"
- (org-babel-next-src-block)
- (org-babel-execute-maybe)
- (re-search-forward "results" nil t)
- (forward-line)
- (should (string=
- ""
- (buffer-substring-no-properties (point-at-bol) (point-at-eol))))))
- (ert-deftest ob-emacs-lisp/commented-last-block-line ()
- (org-test-with-temp-text-in-file "
- #+begin_src emacs-lisp :var a=2
- 2;;
- #+end_src"
- (org-babel-next-src-block)
- (org-babel-execute-maybe)
- (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)
-
|