From a7d27114e3597ba51c5107a18eb1339b55e8aebd Mon Sep 17 00:00:00 2001 From: not manx Date: Wed, 22 Jul 2020 00:24:10 +0000 Subject: [PATCH] Add tests for headers and links --- ox-plumhtml-tests.el | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/ox-plumhtml-tests.el b/ox-plumhtml-tests.el index a242efb..c53d8e0 100644 --- a/ox-plumhtml-tests.el +++ b/ox-plumhtml-tests.el @@ -9,6 +9,11 @@ (should (string= expected-result (org-export-string-as org-source 'plumhtml t info))))) +(defun regexp-render-as (expected-regexp org-source &optional info) + (let ((info (plist-put info :html-container nil))) + (should (string-match-p expected-regexp + (org-export-string-as org-source 'plumhtml t info))))) + ;; Tables (ert-deftest body () (should-render-as @@ -44,3 +49,20 @@ (should-render-as "\n\n\n
multi-line
header
body
" "|multi-line|\n|header|\n|---|\n|body|")) + +;; Headers and IDs +(ert-deftest header () + (should-render-as + "

mwee

" + "* mwee")) + +(ert-deftest header-export-ids () + (regexp-render-as + "

mwee

" + "* mwee" '(:export-header-ids t))) + +;; Links and IDs +(ert-deftest link () + (should-render-as + "

example

" + "[[https://example.com][example]]"))