test-org-html.el 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. ;;; test-org-html.el
  2. ;; Copyright (c) ߛ David Maus
  3. ;; Authors: David Maus
  4. ;; Released under the GNU General Public License version 3
  5. ;; see: http://www.gnu.org/licenses/gpl-3.0.html
  6. ;;;; Comments:
  7. ;; Template test file for Org-mode tests
  8. ;;; Code:
  9. (let ((load-path (cons (expand-file-name
  10. ".." (file-name-directory
  11. (or load-file-name buffer-file-name)))
  12. load-path)))
  13. (require 'org-test)
  14. (require 'org-test-ob-consts))
  15. ;;; Tests
  16. (require 'org-html)
  17. (defmacro org-test-html/export-link (name link expected &optional desc opt-plist)
  18. `(ert-deftest ,(intern (concat "test-org-html/export-link/" name)) ()
  19. ,(or desc name)
  20. (should
  21. (string=
  22. (org-test-strip-text-props
  23. (org-html-handle-links ,link ,opt-plist))
  24. ,expected))))
  25. (org-test-html/export-link "mailto" "[[mailto:john@example.tld]]"
  26. "<a href=\"mailto:john@example.tld\">mailto:john@example.tld</a>"
  27. "mailto: link without description")
  28. (provide 'test-org-html)
  29. ;;; test-org-html.el ends here