org-agenda.el (org-agenda-local-vars): Don't include `org-agenda-show-window'
[org-mode.git] / testing / lisp / test-ob-emacs-lisp.el
blob92fb88043a2d000fd5b67b64e42734402a7018e0
1 ;;; test-ob-emacs-lisp.el
3 ;; Copyright (c) 2012, 2013 Free Software Foundation, Inc.
4 ;; Authors: Eric Schulte, Martyn Jago
6 ;; This file is not part of GNU Emacs.
8 ;; This program is free software; you can redistribute it and/or modify
9 ;; it under the terms of the GNU General Public License as published by
10 ;; the Free Software Foundation, either version 3 of the License, or
11 ;; (at your option) any later version.
13 ;; This program is distributed in the hope that it will be useful,
14 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;; GNU General Public License for more details.
18 ;; You should have received a copy of the GNU General Public License
19 ;; along with this program. If not, see <http://www.gnu.org/licenses/>.
21 ;;; Comments:
23 ;; Org-mode tests for ob-emacs-lisp.el live here
25 ;;; Code:
26 (ert-deftest ob-emacs-lisp/commented-last-block-line-no-var ()
27 (org-test-with-temp-text-in-file "
28 #+begin_src emacs-lisp
30 #+end_src"
31 (progn
32 (org-babel-next-src-block)
33 (org-ctrl-c-ctrl-c)
34 (should (re-search-forward "results:" nil t))
35 (forward-line)
36 (should
37 (string=
38 ""
39 (buffer-substring-no-properties (point-at-bol) (point-at-eol))))))
40 (org-test-with-temp-text-in-file "
41 #+begin_src emacs-lisp
42 \"some text\";;
43 #+end_src"
45 (progn
46 (org-babel-next-src-block)
47 (org-ctrl-c-ctrl-c)
48 (should (re-search-forward "results:" nil t))
49 (forward-line)
50 (should
51 (string=
52 ": some text"
53 (buffer-substring-no-properties (point-at-bol) (point-at-eol)))))))
55 (ert-deftest ob-emacs-lisp/commented-last-block-line-with-var ()
56 (org-test-with-temp-text-in-file "
57 #+begin_src emacs-lisp :var a=1
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 ""
67 (buffer-substring-no-properties (point-at-bol) (point-at-eol))))))
68 (org-test-with-temp-text-in-file "
69 #+begin_src emacs-lisp :var a=2
70 2;;
71 #+end_src"
72 (progn
73 (org-babel-next-src-block)
74 (org-ctrl-c-ctrl-c)
75 (re-search-forward "results" nil t)
76 (forward-line)
77 (should (string=
78 ": 2"
79 (buffer-substring-no-properties (point-at-bol) (point-at-eol)))))))
80 (provide 'test-ob-emacs-lisp)
82 ;;; test-ob-emacs-lisp.el ends here