forked from mirrors/org-mode
test: re-arranging example files into their own directory
This commit is contained in:
parent
d6143f1e7a
commit
41cde9d9bd
10
testing/examples/link-in-heading.org
Normal file
10
testing/examples/link-in-heading.org
Normal file
|
@ -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
|
|
@ -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."
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue