From aad4d251568125c7f3938237a8fc5d44552bbea1 Mon Sep 17 00:00:00 2001 From: Asko Nomm Date: Sat, 9 Apr 2022 15:03:23 +0200 Subject: Add full test coverage for strikethrough text (re #4) --- resources/test/core.md | 2 +- resources/test/core_result.html | 2 +- test/clarktown/parsers/strikethrough_test.clj | 14 ++++++++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 test/clarktown/parsers/strikethrough_test.clj 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) {

Hi there, world!

- +
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) + "This is strikethrough text."))) + + (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, This is strikethrough text. And more text.")))) \ No newline at end of file -- cgit v1.2.3