Ver código fonte

test org-current-export-file->buffer behavior

Conflicts:

	testing/lisp/test-ob-exp.el: Resolving conflicts.
Eric Schulte 13 anos atrás
pai
commit
72fe32f17b
1 arquivos alterados com 24 adições e 0 exclusões
  1. 24 0
      testing/lisp/test-ob-exp.el

+ 24 - 0
testing/lisp/test-ob-exp.el

@@ -249,6 +249,30 @@ elements in the final html."
       (should-not (string-match (regexp-quote "<<strip-export-1>>") ascii))
       (should-not (string-match (regexp-quote "i=\"10\"") ascii)))))
 
+(ert-deftest ob-exp/export-from-a-temp-buffer ()
+  (org-test-with-temp-text
+      "
+#+Title: exporting from a temporary buffer
+
+#+name: foo
+#+BEGIN_SRC emacs-lisp
+  :foo
+#+END_SRC
+
+#+name: bar
+#+BEGIN_SRC emacs-lisp
+  :bar
+#+END_SRC
+
+#+BEGIN_SRC emacs-lisp :var foo=foo :noweb yes :exports results
+  (list foo <<bar>>)
+#+END_SRC
+"
+    (let* ((org-current-export-file (current-buffer))
+	   (ascii (org-export-as-ascii nil nil nil 'string)))
+      (should (string-match (regexp-quote (format nil "%S" '(:foo :bar)))
+			    ascii)))))
+
 (provide 'test-ob-exp)
 
 ;;; test-ob-exp.el ends here