Bläddra i källkod

test the combination of code block results wrapper and type

* testing/examples/babel.org (an): Test the combination of code block
  results wrapper and type.
* testing/lisp/test-ob.el (test-org-babel/combining-scalar-and-raw-result-types):
  Test the combination of code block results wrapper and type.
Eric Schulte 13 år sedan
förälder
incheckning
7eaa67260b
2 ändrade filer med 30 tillägg och 0 borttagningar
  1. 18 0
      testing/examples/babel.org
  2. 12 0
      testing/lisp/test-ob.el

+ 18 - 0
testing/examples/babel.org

@@ -289,3 +289,21 @@ src_sh{echo "One"} block at start of line
  One spaced block in  src_sh{ echo "middle" } of line 
 src_sh{echo 2} blocks on the src_emacs-lisp{"same"} line
  Inline block with src_sh[:results silent]{ echo "parameters" }.
+* returning file names -- interpreted as lists
+  :PROPERTIES:
+  :ID:       a73a2ab6-b8b2-4c0e-ae7f-23ad14eab7bc
+  :END:
+
+#+begin_src sh :results scalar
+  echo "[[file:./cv.cls]]"
+#+end_src
+
+#+results:
+: [[file:./cv.cls]]
+
+#+begin_src sh :results raw scalar
+   echo "[[file:./cv.cls]]"
+#+end_src
+
+#+results:
+[[file:./cv.cls]]

+ 12 - 0
testing/lisp/test-ob.el

@@ -409,6 +409,18 @@
       (should (string= (concat test-line " =\"x\"=")
 		       (buffer-substring-no-properties (point-min) (point-max)))))))
 
+(ert-deftest test-org-babel/combining-scalar-and-raw-result-types ()
+  (flet ((next-result ()
+		      (org-babel-next-src-block)
+		      (org-babel-execute-src-block)
+		      (goto-char (org-babel-where-is-src-block-result))
+		      (forward-line 1)))
+    (org-test-at-id "a73a2ab6-b8b2-4c0e-ae7f-23ad14eab7bc"
+      (next-result)
+      (should (org-babel-in-example-or-verbatim))
+      (next-result)
+      (should (not (org-babel-in-example-or-verbatim))))))
+
 (provide 'test-ob)
 
 ;;; test-ob ends here