diff options
| author | Asko Nomm <asko@bien.ee> | 2022-04-09 15:03:23 +0200 |
|---|---|---|
| committer | Asko Nomm <asko@bien.ee> | 2022-04-09 15:03:23 +0200 |
| commit | aad4d251568125c7f3938237a8fc5d44552bbea1 (patch) | |
| tree | ff7d399e9c950daf69b4d050fd5f0d2671d5095e | |
| parent | 732eeb88b4754e7945249c650fbe79ce5c7af063 (diff) | |
Add full test coverage for strikethrough text (re #4)
| -rw-r--r-- | resources/test/core.md | 2 | ||||
| -rw-r--r-- | resources/test/core_result.html | 2 | ||||
| -rw-r--r-- | test/clarktown/parsers/strikethrough_test.clj | 14 |
3 files changed, 16 insertions, 2 deletions
diff --git a/resources/test/core.md b/resources/test/core.md index 1770f21..6c476a9 100644 --- a/resources/test/core.md +++ b/resources/test/core.md @@ -55,7 +55,7 @@ This is ___bold italic text___ and ***this is also***. *What about italic text t ## Hi there, world! * List item -* Another list item +* Another list ~~item~~ * Sub list item * Another sub list item * Sub sub list item diff --git a/resources/test/core_result.html b/resources/test/core_result.html index 0f242a7..bf9cc55 100644 --- a/resources/test/core_result.html +++ b/resources/test/core_result.html @@ -46,7 +46,7 @@ function markdownToHTML(markdown) { <h2>Hi there, world!</h2> -<ul><li>List item</li><li>Another list item<ul><li>Sub list item</li><li>Another sub list item<ul><li>Sub sub list item</li><li>Continuing sub list item</li></ul></li></ul></li><li>Continuing list item</li></ul> +<ul><li>List item</li><li>Another list <del>item</del><ul><li>Sub list item</li><li>Another sub list item<ul><li>Sub sub list item</li><li>Continuing sub list item</li></ul></li></ul></li><li>Continuing list item</li></ul> <hr> diff --git a/test/clarktown/parsers/strikethrough_test.clj b/test/clarktown/parsers/strikethrough_test.clj new file mode 100644 index 0000000..fdf6188 --- /dev/null +++ b/test/clarktown/parsers/strikethrough_test.clj @@ -0,0 +1,14 @@ +(ns clarktown.parsers.strikethrough-test + (:require + [clojure.test :refer [deftest testing is]] + [clarktown.parsers.strikethrough :as strikethrough])) + + +(deftest strikethrough-test + (testing "Creating strikethrough text" + (is (= (strikethrough/render "~~This is strikethrough text.~~" nil) + "<del>This is strikethrough text.</del>"))) + + (testing "Creating strikethrough text mixed with regular text" + (is (= (strikethrough/render "Some other text, ~~This is strikethrough text.~~ And more text." nil) + "Some other text, <del>This is strikethrough text.</del> And more text."))))
\ No newline at end of file |
