test the new file-desc header argument
[org-mode.git] / testing / lisp / test-ob-emacs-lisp.el
blobf262ff7474f314f8b391f7eb453e1bcfd6cc6e35
1 ;;; test-ob-emacs-lisp.el
3 ;; Copyright (c) 2012 Free Software Foundation, Inc.
4 ;; Authors: Eric Schulte, Martyn Jago
6 ;; Released under the GNU General Public License version 3
7 ;; see: http://www.gnu.org/licenses/gpl-3.0.html
9 ;;;; Comments:
11 ;; Org-mode tests for ob-emacs-lisp.el live here
13 ;;; Code:
14 (ert-deftest ob-emacs-lisp/commented-last-block-line-no-var ()
15 (org-test-with-temp-text-in-file "
16 #+begin_src emacs-lisp
18 #+end_src"
19 (progn
20 (org-babel-next-src-block)
21 (org-ctrl-c-ctrl-c)
22 (should (re-search-forward "results:" nil t))
23 (forward-line)
24 (should
25 (string=
26 ""
27 (buffer-substring-no-properties (point-at-bol) (point-at-eol))))))
28 (org-test-with-temp-text-in-file "
29 #+begin_src emacs-lisp
30 \"some text\";;
31 #+end_src"
33 (progn
34 (org-babel-next-src-block)
35 (org-ctrl-c-ctrl-c)
36 (should (re-search-forward "results:" nil t))
37 (forward-line)
38 (should
39 (string=
40 ": some text"
41 (buffer-substring-no-properties (point-at-bol) (point-at-eol)))))))
43 (ert-deftest ob-emacs-lisp/commented-last-block-line-with-var ()
44 (org-test-with-temp-text-in-file "
45 #+begin_src emacs-lisp :var a=1
47 #+end_src"
48 (progn
49 (org-babel-next-src-block)
50 (org-ctrl-c-ctrl-c)
51 (re-search-forward "results" nil t)
52 (forward-line)
53 (should (string=
54 ""
55 (buffer-substring-no-properties (point-at-bol) (point-at-eol))))))
56 (org-test-with-temp-text-in-file "
57 #+begin_src emacs-lisp :var a=2
58 2;;
59 #+end_src"
60 (progn
61 (org-babel-next-src-block)
62 (org-ctrl-c-ctrl-c)
63 (re-search-forward "results" nil t)
64 (forward-line)
65 (should (string=
66 ": 2"
67 (buffer-substring-no-properties (point-at-bol) (point-at-eol)))))))
68 (provide 'test-ob-emacs-lisp)
70 ;;; test-ob-emacs-lisp.el ends here