mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-09-12 06:39:54 +00:00
I started from the 78ec8e commit then cherry-picked and squashed commits that have been done in master since then, except the bad commits that overwrote the tree (in master) with the tree in maint. This commit also bumps the version number to 7.8.06. The only "fix" that was made between 78ec8e and the previous commit is e0072f which has been reported to break stuff.
71 lines
1.8 KiB
EmacsLisp
71 lines
1.8 KiB
EmacsLisp
;;; test-ob-emacs-lisp.el
|
|
|
|
;; Copyright (c) 2012 Free Software Foundation, Inc.
|
|
;; Authors: Eric Schulte, Martyn Jago
|
|
|
|
;; Released under the GNU General Public License version 3
|
|
;; see: http://www.gnu.org/licenses/gpl-3.0.html
|
|
|
|
;;;; Comments:
|
|
|
|
;; Org-mode tests for ob-emacs-lisp.el live here
|
|
|
|
;;; Code:
|
|
(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)
|
|
|
|
;;; test-ob-emacs-lisp.el ends here
|