Manually revert back to commit e85080.
[org-mode.git] / testing / lisp / test-property-inheritance.el
blob60e955d30631e0183be100ed2f16d8ec33171b7f
1 ;;; test-ob-R.el --- tests for ob-R.el
3 ;; Copyright (c) 2011 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))
23 (ert-deftest test-org-property-accumulation-top-use ()
24 (test-org-in-property-buffer
25 (goto-char (point-min))
26 (org-babel-next-src-block 1)
27 (should (equal 3 (org-babel-execute-src-block)))))
29 (ert-deftest test-org-property-accumulation-top-val ()
30 (test-org-in-property-buffer
31 (goto-char (point-min))
32 (org-babel-next-src-block 2)
33 (should (string= "foo=1 bar=2" (org-babel-execute-src-block)))))
35 (ert-deftest test-org-property-accumulation-overwrite-use ()
36 (test-org-in-property-buffer
37 (goto-char (point-min))
38 (org-babel-next-src-block 3)
39 (should (= 7 (org-babel-execute-src-block)))))
41 (ert-deftest test-org-property-accumulation-overwrite-val ()
42 (test-org-in-property-buffer
43 (goto-char (point-min))
44 (org-babel-next-src-block 4)
45 (should (string= "foo=7" (org-babel-execute-src-block)))))
47 (ert-deftest test-org-property-accumulation-append-use ()
48 (test-org-in-property-buffer
49 (goto-char (point-min))
50 (org-babel-next-src-block 5)
51 (should (= 6 (org-babel-execute-src-block)))))
53 (ert-deftest test-org-property-accumulation-append-val ()
54 (test-org-in-property-buffer
55 (goto-char (point-min))
56 (org-babel-next-src-block 6)
57 (should (string= "foo=1 bar=2 baz=3" (org-babel-execute-src-block)))))
59 (provide 'test-ob-R)
61 ;;; test-ob-R.el ends here