diff --git a/testing/example-file-no-header.org b/testing/examples/example-file-no-header.org similarity index 100% rename from testing/example-file-no-header.org rename to testing/examples/example-file-no-header.org diff --git a/testing/examples/link-in-heading.org b/testing/examples/link-in-heading.org new file mode 100644 index 000000000..1b235a2dc --- /dev/null +++ b/testing/examples/link-in-heading.org @@ -0,0 +1,10 @@ +this file has a link in it's heading, which can cause problems + +* [[http://www.example.com][example]] + +what a weird heading... + +#+begin_src emacs-lisp + ;; a8b1d111-eca8-49f0-8930-56d4f0875155 + (message "my heading has a link") +#+end_src diff --git a/testing/example-file.org b/testing/examples/normal.org similarity index 100% rename from testing/example-file.org rename to testing/examples/normal.org diff --git a/testing/lisp/test-ob-exp.el b/testing/lisp/test-ob-exp.el index b71b20069..b0b562bf4 100644 --- a/testing/lisp/test-ob-exp.el +++ b/testing/lisp/test-ob-exp.el @@ -18,17 +18,15 @@ ;;; Tests (ert-deftest test-ob-exp/org-babel-exp-src-blocks/w-no-headers () "Testing export without any headlines in the org-mode file." - (org-test-in-example-file org-test-no-header-example-file-name + (org-test-in-example-file org-test-no-header-file ;; export the file to html (org-export-as-html nil) ;; should create a .html file (should (file-exists-p (concat - (file-name-sans-extension - org-test-no-header-example-file-name) + (file-name-sans-extension org-test-no-header-file) ".html"))) ;; should not create a file with "::" appended to it's name - (should-not (file-exists-p - (concat org-test-no-header-example-file-name "::"))))) + (should-not (file-exists-p (concat org-test-no-header-file "::"))))) (ert-deftest test-ob-exp/org-babel-exp-src-blocks/w-no-file () "Testing export from buffers which are not visiting any file." diff --git a/testing/org-test.el b/testing/org-test.el index 9d1b5a657..82d954261 100644 --- a/testing/org-test.el +++ b/testing/org-test.el @@ -56,11 +56,17 @@ org-test searches this directory up the directory tree.") (defconst org-base-dir (expand-file-name ".." org-test-dir)) -(defconst org-test-example-file-name - (expand-file-name "example-file.org" org-test-dir)) +(defconst org-test-example-dir + (expand-file-name "examples" org-test-dir)) -(defconst org-test-no-header-example-file-name - (expand-file-name "example-file-no-header.org" org-test-dir)) +(defconst org-test-file + (expand-file-name "normal.org" org-test-example-dir)) + +(defconst org-test-no-header-file + (expand-file-name "no-header.org" org-test-dir)) + +(defconst org-test-link-in-heading-file + (expand-file-name "link-in-heading.org" org-test-dir)) (defconst test-org-code-block-anchor "94839181-184f-4ff4-a72f-94214df6f5ba") @@ -80,7 +86,7 @@ currently executed.") (defmacro org-test-in-example-file (file &rest body) "Execute body in the Org-mode example file." (declare (indent 1)) - `(let* ((my-file (or ,file org-test-example-file-name)) + `(let* ((my-file (or ,file org-test-file)) (visited-p (get-file-buffer my-file)) to-be-removed) (save-window-excursion