Update copyright years.
[org-mode.git] / testing / lisp / test-property-inheritance.el
bloba84160fa3116b733c8296b0d36c41d4f9e547f4a
1 ;;; test-ob-R.el --- tests for ob-R.el
3 ;; Copyright (c) 2011-2014 Eric Schulte
4 ;; Authors: Eric Schulte
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 ;;; Code:
22 (defmacro test-org-in-property-buffer (&rest body)
23 `(with-temp-buffer
24 (insert-file-contents (expand-file-name "property-inheritance.org"
25 org-test-example-dir))
26 (org-mode)
27 ,@body))
28 (def-edebug-spec test-org-in-property-buffer (body))
30 (ert-deftest test-org-property-accumulation-top-use ()
31 (test-org-in-property-buffer
32 (goto-char (point-min))
33 (org-babel-next-src-block 1)
34 (should (equal 3 (org-babel-execute-src-block)))))
36 (ert-deftest test-org-property-accumulation-top-val ()
37 (test-org-in-property-buffer
38 (goto-char (point-min))
39 (org-babel-next-src-block 2)
40 (should (string= "foo=1 bar=2" (org-babel-execute-src-block)))))
42 (ert-deftest test-org-property-accumulation-overwrite-use ()
43 (test-org-in-property-buffer
44 (goto-char (point-min))
45 (org-babel-next-src-block 3)
46 (should (= 7 (org-babel-execute-src-block)))))
48 (ert-deftest test-org-property-accumulation-overwrite-val ()
49 (test-org-in-property-buffer
50 (goto-char (point-min))
51 (org-babel-next-src-block 4)
52 (should (string= "foo=7" (org-babel-execute-src-block)))))
54 (ert-deftest test-org-property-accumulation-append-use ()
55 (test-org-in-property-buffer
56 (goto-char (point-min))
57 (org-babel-next-src-block 5)
58 (should (= 6 (org-babel-execute-src-block)))))
60 (ert-deftest test-org-property-accumulation-append-val ()
61 (test-org-in-property-buffer
62 (goto-char (point-min))
63 (org-babel-next-src-block 6)
64 (should (string= "foo=1 bar=2 baz=3" (org-babel-execute-src-block)))))
66 (provide 'test-ob-R)
68 ;;; test-ob-R.el ends here