From 90c2e30cd27e783670856ff618efc5c0d4674bdd Mon Sep 17 00:00:00 2001 From: Mehmet Tekman Date: Fri, 4 Aug 2023 13:06:58 +0200 Subject: [PATCH 3/4] * testing/lisp/test-ob.el: update tests according to new merge strategy, with emphasis on `:tangle' headers for syncing actions. updated test --- testing/lisp/test-ob.el | 43 ++++++++++++++++++++++++++++++++--------- 1 file changed, 34 insertions(+), 9 deletions(-) diff --git a/testing/lisp/test-ob.el b/testing/lisp/test-ob.el index f12533258..d51937b69 100644 --- a/testing/lisp/test-ob.el +++ b/testing/lisp/test-ob.el @@ -337,7 +337,7 @@ PROPERTIES is a list of property keywords or a single keyword." #+begin_src conf #+end_src" (test-ob/get-src-block-property :tangle)))) - (should-not ;; 2. inherit-document-header-with-local-sync-action + (should ;; 2. inherit-document-header-with-local-sync-action ;; This should pass with newer merge function with multiple tangle parameters (equal '(:tangle "/tmp/default_tangle.txt skip") (org-test-with-temp-text @@ -377,7 +377,7 @@ PROPERTIES is a list of property keywords or a single keyword." #+begin_src conf :tangle randomfile #+end_src" (test-ob/get-src-block-property '(:tangle :results))))) - (should-not ;; 6. inherit-document-tfile-take-only-last-local-sync-action + (should ;; 6. inherit-document-tfile-take-only-last-local-sync-action ;; This should pass with newer merge function with multiple tangle parameters (equal '(:tangle "/tmp/default_tangle.txt export") (org-test-with-temp-text @@ -387,7 +387,7 @@ PROPERTIES is a list of property keywords or a single keyword." #+begin_src conf :tangle import export #+end_src" (test-ob/get-src-block-property :tangle)))) - (should-not ;; 7. ignore-document-header-take-last-tfile-and-sync-action + (should ;; 7. ignore-document-header-take-last-tfile-and-sync-action ;; This should pass with newer merge function with multiple tangle parameters (equal '(:tangle "fname2 export") (org-test-with-temp-text @@ -426,9 +426,8 @@ PROPERTIES is a list of property keywords or a single keyword." #+begin_src conf :tangle \"foo.txt\" :comments link #+end_src" (test-ob/get-src-block-property '(:tangle :exports :comments))))) - (should-not ;; 11. override-document-and-heading-tfile-with-yes - ;; This should pass with newer merge function with multiple tangle parameters - (equal '(:tangle "foo.txt") + (should ;; 11. override-document-and-heading-tfile-with-yes + (equal '(:tangle "yes") (org-test-with-temp-text "\ #+PROPERTY: header-args :tangle /tmp/default_tangle.txt @@ -439,18 +438,44 @@ PROPERTIES is a list of property keywords or a single keyword." #+begin_src conf :tangle yes #+end_src" (test-ob/get-src-block-property :tangle)))) - (should ;; 12. tangle-file-with-spaces + (should ;; 12. simple-file-with-spaces + (equal '(:tangle "file with spaces.txt import") + (org-test-with-temp-text "\ +#+PROPERTY: header-args :tangle \"file with spaces.txt\" sync +* Twelve +#+begin_src conf :tangle import +#+end_src" + (test-ob/get-src-block-property :tangle)))) + (should ;; 13. hierarchical-tangle-file-with-spaces (equal '(:tangle "file with spaces.txt") (org-test-with-temp-text "\ -* Twelve +* Thirteen :PROPERTIES: :header-args: :tangle \"foo.txt\" :END: ** A #+begin_src conf :tangle \"file with spaces.txt\" #+end_src" - (test-ob/get-src-block-property :tangle))))) + (test-ob/get-src-block-property :tangle)))) + (should ;; 14. do-not-tangle + (equal '(:tangle "no") + (org-test-with-temp-text + "\ +#+PROPERTY: header-args :tangle /tmp/default_tangle.txt +* Fourteen +#+begin_src emacs-lisp :tangle no +#+end_src" + (test-ob/get-src-block-property :tangle)))) + (should ;; 15. headers-dont-cancel-out + (equal '(:tangle "relative.el") + (org-test-with-temp-text + "\ +#+PROPERTY: header-args :tangle relative.el +* Fifteen +#+begin_src emacs-lisp :tangle relative.el +#+end_src" + (test-ob/get-src-block-property :tangle))))) (ert-deftest test-ob/inline-src-blocks () (should -- 2.41.0