>From 68a64d29222548eff3f414b8881f583f50ea4a96 Mon Sep 17 00:00:00 2001 From: Martyn Jago Date: Thu, 17 Nov 2011 12:33:08 +0000 Subject: [PATCH] Tests for testing basic `#+call: block-name()' actually cause block execution * testing/lisp/test-ob.el: --- testing/lisp/test-ob.el | 38 ++++++++++++++++++++++++++++++++++++++ 1 files changed, 38 insertions(+), 0 deletions(-) diff --git a/testing/lisp/test-ob.el b/testing/lisp/test-ob.el index d145f4e..3fefe91 100644 --- a/testing/lisp/test-ob.el +++ b/testing/lisp/test-ob.el @@ -499,4 +499,42 @@ on two lines (provide 'test-ob) +(ert-deftest test-org-babel/basic-call-execution-bol() + "Test that executing #+call: with point on # executes the block" + (org-test-with-temp-text + " +#+call: my-test() +#+srcname: my-test +#+begin_src emacs-lisp + (+ 2 3) +#+end_src " + + (should (search-forward "#+call:")) + (beginning-of-line) + (org-ctrl-c-ctrl-c) + (should (search-forward "#+results: my-test()")) + (forward-line) + (should (string= ": 5" + (buffer-substring-no-properties + (point-at-bol) (point-at-eol)))))) + +(ert-deftest test-org-babel/basic-call-execution-eol() + "Test that executing #+call: with point at eol executes the block" + (org-test-with-temp-text + " +#+call: my-test() +#+srcname: my-test +#+begin_src emacs-lisp + (* 2 3) +#+end_src " + + (should (search-forward "#+call:")) + (end-of-line) + (org-ctrl-c-ctrl-c) + (should (search-forward "#+results: my-test()")) + (forward-line) + (should (string= ": 6" + (buffer-substring-no-properties + (point-at-bol) (point-at-eol)))))) + ;;; test-ob ends here -- 1.7.3.4