Browse Source

ob-scheme: Add tests for scheme result types

* test-ob-scheme.el (test-ob-scheme/verbatim, test-ob-scheme/list):
  New tests.
Henry Blevins 2 years ago
parent
commit
f2500e06f3
1 changed files with 20 additions and 0 deletions
  1. 20 0
      testing/lisp/test-ob-scheme.el

+ 20 - 0
testing/lisp/test-ob-scheme.el

@@ -39,6 +39,26 @@
 	   (org-babel-execute-maybe)
 	   (buffer-string))))
 
+(ert-deftest test-ob-scheme/verbatim ()
+  "Test verbatim output."
+  (should
+   (equal ": (1 2 3)\n"
+	  (org-test-with-temp-text "#+begin_src scheme :results verbatim\n'(1 2 3)\n#+end_src"
+	    (org-babel-execute-src-block)
+	    (let ((case-fold-search t)) (search-forward "#+results"))
+	    (buffer-substring-no-properties (line-beginning-position 2)
+					    (point-max))))))
+
+(ert-deftest test-ob-scheme/list ()
+  "Test list output."
+  (should
+   (equal "- 1\n- 2\n- 3\n"
+	  (org-test-with-temp-text "#+begin_src scheme :results list\n'(1 2 3)\n#+end_src"
+	    (org-babel-execute-maybe)
+	    (let ((case-fold-search t)) (search-forward "#+results"))
+	    (buffer-substring-no-properties (line-beginning-position 2)
+					    (point-max))))))
+
 (ert-deftest test-ob-scheme/prologue ()
   "Test :prologue parameter."
   (should