From f98ee77b38e7b6895ade78d7465f40185e50a310 Mon Sep 17 00:00:00 2001 From: Eric Schulte Date: Fri, 11 Nov 2011 14:24:23 -0700 Subject: [PATCH] tests protecting nested code blocks * testing/lisp/test-ob.el (test-org-babel/nested-code-block): Evaluation of a nested block. (test-org-babel/partial-nested-code-block): Evaluation of a partially nested block. --- testing/lisp/test-ob.el | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/testing/lisp/test-ob.el b/testing/lisp/test-ob.el index 738df52e3..89b4dc851 100644 --- a/testing/lisp/test-ob.el +++ b/testing/lisp/test-ob.el @@ -403,6 +403,23 @@ duplicate results block." (should (search-forward "Hello")) ; the same string in the results block (should-error (search-forward "Hello")))) +(ert-deftest test-org-babel/nested-code-block () + "Test nested code blocks inside code blocks don't cause problems." + (org-test-with-temp-text "#+begin_src org :results silent + ,#+begin_src emacs-lisp + , 'foo + ,#+end_src +#+end_src" + (should (string= (org-babel-execute-src-block) + "#+begin_src emacs-lisp\n 'foo\n#+end_src")))) + +(ert-deftest test-org-babel/partial-nested-code-block () + "Test nested code blocks inside code blocks don't cause problems." + (org-test-with-temp-text "#+begin_src org :results silent + ,#+begin_src emacs-lisp +#+end_src" + (should (string= "#+begin_src emacs-lisp" (org-babel-execute-src-block))))) + (provide 'test-ob) ;;; test-ob ends here -- 2.11.4.GIT