diff options
author | Eric Schulte <schulte.eric@gmail.com> | 2010-10-15 12:38:48 -0600 |
---|---|---|
committer | Dan Davison <davison@stats.ox.ac.uk> | 2010-10-21 13:05:59 +0100 |
commit | 3d2aec35887dcae1f7a073c63883ae2c2577e111 (patch) | |
tree | 5e47bcd87aa09f3f27f3b662d7c6eb9123c84744 | |
parent | a9f3c9fe110f0aa39753b3b97fa82c9d60244292 (diff) | |
download | org-mode-3d2aec35887dcae1f7a073c63883ae2c2577e111.tar.gz |
adding simple test of variable resolution
-rw-r--r-- | testing/examples/babel.org | 18 | ||||
-rw-r--r-- | testing/lisp/test-ob.el | 8 |
2 files changed, 24 insertions, 2 deletions
diff --git a/testing/examples/babel.org b/testing/examples/babel.org index 8294e3f..acfa5c8 100644 --- a/testing/examples/babel.org +++ b/testing/examples/babel.org @@ -41,7 +41,6 @@ #+results: : 4 - * excessive id links on tangling :PROPERTIES: :ID: ef06fd7f-012b-4fde-87a2-2ae91504ea7e @@ -59,3 +58,20 @@ #+begin_src emacs-lisp :tangle no (message "for tangling") #+end_src +* simple variable resolution + :PROPERTIES: + :ID: f68821bc-7f49-4389-85b5-914791ee3718 + :END: + +#+source: four +#+begin_src emacs-lisp + (list 1 2 3 4) +#+end_src + +#+begin_src emacs-lisp :var four=four + (length four) +#+end_src + +#+results: +: 4 + diff --git a/testing/lisp/test-ob.el b/testing/lisp/test-ob.el index 69859f3..2322b5c 100644 --- a/testing/lisp/test-ob.el +++ b/testing/lisp/test-ob.el @@ -36,14 +36,20 @@ (let ((info (org-babel-get-src-block-info))) (should (string= "no" (cdr (assoc :tangle (nth 2 info)))))))) -;;; elisp forms in header arguments (ert-deftest test-org-babel-elisp-in-header-arguments () + "Test execution of elisp forms in header arguments." ;; at the babel.org:elisp-forms-in-header-arguments header (org-test-at-id "22d67284-bf14-4cdc-8319-f4bd876829d7" (org-babel-next-src-block) (let ((info (org-babel-get-src-block-info))) (should (= 4 (org-babel-execute-src-block)))))) +(ert-deftest test-org-babel-simple-variable-resolution () + "Test that simple variable resolution is working." + (org-test-at-id "f68821bc-7f49-4389-85b5-914791ee3718" + (org-babel-next-src-block 2) + (should (= 4 (org-babel-execute-src-block))))) + (provide 'test-ob) ;;; test-ob ends here
\ No newline at end of file |