org.el: Fix bug in done headline fontification.
[org-mode/org-mode-NeilSmithlineMods.git] / testing / lisp / test-property-inheritance.el
blob24784130840879d64d9e76272e2ec081eafe925e
1 ;;; test-ob-R.el --- tests for ob-R.el
3 ;; Copyright (c) 2011-2012 Eric Schulte
4 ;; Authors: Eric Schulte
6 ;; Released under the GNU General Public License version 3
7 ;; see: http://www.gnu.org/licenses/gpl-3.0.html
9 (let ((load-path (cons (expand-file-name
10 ".." (file-name-directory
11 (or load-file-name buffer-file-name)))
12 load-path)))
13 (require 'org-test)
14 (require 'org-test-ob-consts))
16 (defmacro test-org-in-property-buffer (&rest body)
17 `(with-temp-buffer
18 (insert-file-contents (expand-file-name "property-inheritance.org"
19 org-test-example-dir))
20 (org-mode)
21 ,@body))
22 (def-edebug-spec test-org-in-property-buffer (body))
24 (ert-deftest test-org-property-accumulation-top-use ()
25 (test-org-in-property-buffer
26 (goto-char (point-min))
27 (org-babel-next-src-block 1)
28 (should (equal 3 (org-babel-execute-src-block)))))
30 (ert-deftest test-org-property-accumulation-top-val ()
31 (test-org-in-property-buffer
32 (goto-char (point-min))
33 (org-babel-next-src-block 2)
34 (should (string= "foo=1 bar=2" (org-babel-execute-src-block)))))
36 (ert-deftest test-org-property-accumulation-overwrite-use ()
37 (test-org-in-property-buffer
38 (goto-char (point-min))
39 (org-babel-next-src-block 3)
40 (should (= 7 (org-babel-execute-src-block)))))
42 (ert-deftest test-org-property-accumulation-overwrite-val ()
43 (test-org-in-property-buffer
44 (goto-char (point-min))
45 (org-babel-next-src-block 4)
46 (should (string= "foo=7" (org-babel-execute-src-block)))))
48 (ert-deftest test-org-property-accumulation-append-use ()
49 (test-org-in-property-buffer
50 (goto-char (point-min))
51 (org-babel-next-src-block 5)
52 (should (= 6 (org-babel-execute-src-block)))))
54 (ert-deftest test-org-property-accumulation-append-val ()
55 (test-org-in-property-buffer
56 (goto-char (point-min))
57 (org-babel-next-src-block 6)
58 (should (string= "foo=1 bar=2 baz=3" (org-babel-execute-src-block)))))
60 (provide 'test-ob-R)
62 ;;; test-ob-R.el ends here