فهرست منبع

test of caching call line behavior

Eric Schulte 11 سال پیش
والد
کامیت
48c952f23c
1فایلهای تغییر یافته به همراه16 افزوده شده و 0 حذف شده
  1. 16 0
      testing/lisp/test-ob-lob.el

+ 16 - 0
testing/lisp/test-ob-lob.el

@@ -104,6 +104,22 @@ for export
 #+end_example"
     (should (progn (org-export-execute-babel-code) t))))
 
+(ert-deftest test-ob-lob/caching-call-line ()
+  (require 'ox)
+  (let ((temporary-value-for-test nil))
+    (org-test-with-temp-text "
+#+name: call-line-caching-example
+#+begin_src emacs-lisp :var bar=\"baz\"
+  (setq temporary-value-for-test (not temporary-value-for-test))
+#+end_src
+
+#+call: call-line-caching-example(\"qux\") :cache yes
+"
+      (goto-char (point-max)) (forward-line -1)
+      ;; first execution should flip value to t
+      (should (org-babel-lob-execute (org-babel-lob-get-info)))
+      ;; if cached, second evaluation will retain the t value
+      (should (org-babel-lob-execute (org-babel-lob-get-info))))))
 
 (provide 'test-ob-lob)