test-org-html.el 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. ;;; test-org-html.el --- tests for org-html.el
  2. ;; Copyright (c) David Maus
  3. ;; Authors: David Maus
  4. ;; This file is not part of GNU Emacs.
  5. ;; This program is free software; you can redistribute it and/or modify
  6. ;; it under the terms of the GNU General Public License as published by
  7. ;; the Free Software Foundation, either version 3 of the License, or
  8. ;; (at your option) any later version.
  9. ;; This program is distributed in the hope that it will be useful,
  10. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. ;; GNU General Public License for more details.
  13. ;; You should have received a copy of the GNU General Public License
  14. ;; along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. ;;; Comments:
  16. ;; Template test file for Org-mode tests
  17. ;;; Code:
  18. (unless (featurep 'org-html)
  19. (signal 'missing-test-dependency "Support for Org-html"))
  20. (defmacro org-test-html/export-link (name link expected &optional desc opt-plist)
  21. `(ert-deftest ,(intern (concat "test-org-html/export-link/" name)) ()
  22. ,(or desc name)
  23. (should
  24. (string=
  25. (org-test-strip-text-props
  26. (org-html-handle-links ,link ,opt-plist))
  27. ,expected))))
  28. (org-test-html/export-link "mailto" "[[mailto:john@example.tld]]"
  29. "<a href=\"mailto:john@example.tld\">mailto:john@example.tld</a>"
  30. "mailto: link without description")
  31. (provide 'test-org-html)
  32. ;;; test-org-html.el ends here