Browse Source

test-ob: Test indentation of multiline text in list output

* testing/lisp/test-ob.el (test-ob/org-babel-results-indented-list):
Add a regression test for the recent change to ob-core list formatting
in e7005787993f521f76e99f00e8a04d87703c493f.
Rudolf Adamkovič 1 year ago
parent
commit
524e0e0b7b
1 changed files with 23 additions and 0 deletions
  1. 23 0
      testing/lisp/test-ob.el

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

@@ -1175,6 +1175,29 @@ trying to find the :END: marker."
     (org-babel-execute-src-block)
     (org-babel-execute-src-block)))
 
+(ert-deftest test-ob/org-babel-results-indented-list ()
+  "Test that :results value list indents multi-line items correctly."
+  (should
+   (string= "- Foo1
+  Bar1
+- Foo2
+
+  Bar2
+"
+            (org-test-with-temp-text
+                "#+begin_src emacs-lisp :results value list
+'(\"Foo1
+Bar1\"
+  \"Foo2
+
+Bar2\")
+#+end_src"
+              (org-babel-execute-src-block)
+              (org-forward-element)
+              (org-narrow-to-element)
+              (delete-trailing-whitespace)
+              (buffer-string)))))
+
 (ert-deftest test-ob/file-desc-header-argument ()
   "Test that the :file-desc header argument is used."
   (org-test-with-temp-text "#+begin_src emacs-lisp :results file :file-desc bar