Browse Source

ob-tangle: Add a test

* testing/lisp/test-ob-tangle.el (ob-tangle/block-order): Add test.
Nicolas Goaziou 6 years ago
parent
commit
085f150372
1 changed files with 29 additions and 0 deletions
  1. 29 0
      testing/lisp/test-ob-tangle.el

+ 29 - 0
testing/lisp/test-ob-tangle.el

@@ -259,6 +259,35 @@ another block
 
 #+begin_src bar
 2
+#+end_src"
+			      file)
+		    (org-babel-tangle))
+		  (with-temp-buffer
+		    (insert-file-contents file)
+		    (org-split-string (buffer-string))))
+	      (delete-file file)))))
+  ;; Preserve order with mixed languages.
+  (should
+   (equal '("1" "3" "2" "4")
+	  (let ((file (make-temp-file "org-tangle-")))
+	    (unwind-protect
+		(progn
+		  (org-test-with-temp-text-in-file
+		      (format "#+property: header-args :tangle %S
+#+begin_src foo
+1
+#+end_src
+
+#+begin_src bar
+2
+#+end_src
+
+#+begin_src foo
+3
+#+end_src
+
+#+begin_src bar
+4
 #+end_src"
 			      file)
 		    (org-babel-tangle))