No need to call org-back-to-heading with goto argument.
[org-mode/org-mode-NeilSmithlineMods.git] / testing / lisp / test-org-html.el
blob85a8d536f9a8126d8b2e910b45d8a5e909cc4c10
1 ;;; test-org-html.el
3 ;; Copyright (c) ߛ David Maus
4 ;; Authors: David Maus
6 ;; Released under the GNU General Public License version 3
7 ;; see: http://www.gnu.org/licenses/gpl-3.0.html
9 ;;;; Comments:
11 ;; Template test file for Org-mode tests
14 ;;; Code:
15 (let ((load-path (cons (expand-file-name
16 ".." (file-name-directory
17 (or load-file-name buffer-file-name)))
18 load-path)))
19 (require 'org-test)
20 (require 'org-test-ob-consts))
23 ;;; Tests
24 (require 'org-html)
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>"
29 :opt-plist nil))
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'."
46 (let ((count 0))
47 (mapc
48 (lambda (link)
49 (eval
50 `(ert-deftest ,(intern (format "test-org-html/export-link/%d" count)) ()
51 ,(plist-get link :description)
52 (should
53 (string=
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