Преглед изворни кода

adding simple test of variable resolution

Eric Schulte пре 14 година
родитељ
комит
3d2aec3588
2 измењених фајлова са 24 додато и 2 уклоњено
  1. 17 1
      testing/examples/babel.org
  2. 7 1
      testing/lisp/test-ob.el

+ 17 - 1
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
+

+ 7 - 1
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