3 ;; Copyright (c) ߛ David Maus
6 ;; Released under the GNU General Public License version 3
7 ;; see: http://www.gnu.org/licenses/gpl-3.0.html
11 ;; Template test file for Org-mode tests
15 (let ((load-path (cons (expand-file-name
16 ".." (file-name-directory
17 (or load-file-name buffer-file-name
)))
20 (require 'org-test-ob-consts
))
25 (defvar test-org-html
/export-link-alist
26 '((:description
"mailto: link"
27 :link
"[[mailto:john@example.tld]]"
28 :expected
"<a href=\"mailto:john@example.tld\">mailto:john@example.tld</a>"
30 "List of link definitions to test exporting for.
31 Each cell is a property list that defines a link export test
32 using the properties as follows:
34 :description A string with a short description of the test. This
35 is used as the doc-string of the created test.
37 :link A string with the normalized Org mode link to test.
39 :expected A string with the expected HTML markup.
41 :opt-plist A property list with exporting options.")
43 (defun test-org-html/export-link-factory
()
44 "*Create tests for links defined in
45 `test-org-html/export-link-alist'."
50 `(ert-deftest ,(intern (format "test-org-html/export-link/%d" count
)) ()
51 ,(plist-get link
:description
)
54 ,(plist-get link
:expected
)
55 (org-test-strip-text-props
56 (org-html-handle-links ,(plist-get link
:link
) ,(plist-get link
:opt-plist
)))))))
57 (setq count
(1+ count
))) test-org-html
/export-link-alist
)))
59 ;; Create tests for link export
60 (test-org-html/export-link-factory
)
62 (provide 'test-org-html
)
64 ;;; test-org-html.el ends here