From 52203a49aa544b2c11c96445d8732893160c436b Mon Sep 17 00:00:00 2001 From: Asko Nõmm Date: Tue, 19 Apr 2022 17:50:19 +0300 Subject: WIP #16 Pretty much done. Needs more testing. And new documentation. --- test/clarktown/matchers/empty_block_test.clj | 9 +++++ .../matchers/horizontal_line_block_test.clj | 14 +++++++ test/clarktown/matchers/quote_block_test.clj | 11 ++++++ test/clarktown/parsers/bold_test.clj | 18 --------- test/clarktown/parsers/code_block_test.clj | 15 -------- test/clarktown/parsers/empty_block_test.clj | 14 ------- test/clarktown/parsers/heading_block_test.clj | 44 ---------------------- .../parsers/horizontal_line_block_test.clj | 21 ----------- test/clarktown/parsers/inline_code_test.clj | 14 ------- test/clarktown/parsers/italic_test.clj | 18 --------- test/clarktown/parsers/link_and_image_test.clj | 23 ----------- test/clarktown/parsers/quote_block_test.clj | 15 -------- test/clarktown/parsers/strikethrough_test.clj | 14 ------- test/clarktown/renderers/bold_test.clj | 18 +++++++++ test/clarktown/renderers/code_block_test.clj | 15 ++++++++ test/clarktown/renderers/empty_block_test.clj | 10 +++++ test/clarktown/renderers/heading_block_test.clj | 44 ++++++++++++++++++++++ .../renderers/horizontal_line_block_test.clj | 13 +++++++ test/clarktown/renderers/inline_code_test.clj | 14 +++++++ test/clarktown/renderers/italic_test.clj | 18 +++++++++ test/clarktown/renderers/link_and_image_test.clj | 23 +++++++++++ test/clarktown/renderers/quote_block_test.clj | 10 +++++ test/clarktown/renderers/strikethrough_test.clj | 14 +++++++ 23 files changed, 213 insertions(+), 196 deletions(-) create mode 100644 test/clarktown/matchers/empty_block_test.clj create mode 100644 test/clarktown/matchers/horizontal_line_block_test.clj create mode 100644 test/clarktown/matchers/quote_block_test.clj delete mode 100644 test/clarktown/parsers/bold_test.clj delete mode 100644 test/clarktown/parsers/code_block_test.clj delete mode 100644 test/clarktown/parsers/empty_block_test.clj delete mode 100644 test/clarktown/parsers/heading_block_test.clj delete mode 100644 test/clarktown/parsers/horizontal_line_block_test.clj delete mode 100644 test/clarktown/parsers/inline_code_test.clj delete mode 100644 test/clarktown/parsers/italic_test.clj delete mode 100644 test/clarktown/parsers/link_and_image_test.clj delete mode 100644 test/clarktown/parsers/quote_block_test.clj delete mode 100644 test/clarktown/parsers/strikethrough_test.clj create mode 100644 test/clarktown/renderers/bold_test.clj create mode 100644 test/clarktown/renderers/code_block_test.clj create mode 100644 test/clarktown/renderers/empty_block_test.clj create mode 100644 test/clarktown/renderers/heading_block_test.clj create mode 100644 test/clarktown/renderers/horizontal_line_block_test.clj create mode 100644 test/clarktown/renderers/inline_code_test.clj create mode 100644 test/clarktown/renderers/italic_test.clj create mode 100644 test/clarktown/renderers/link_and_image_test.clj create mode 100644 test/clarktown/renderers/quote_block_test.clj create mode 100644 test/clarktown/renderers/strikethrough_test.clj (limited to 'test/clarktown') diff --git a/test/clarktown/matchers/empty_block_test.clj b/test/clarktown/matchers/empty_block_test.clj new file mode 100644 index 0000000..8fe83e4 --- /dev/null +++ b/test/clarktown/matchers/empty_block_test.clj @@ -0,0 +1,9 @@ +(ns clarktown.matchers.empty-block-test + (:require + [clojure.test :refer [deftest testing is]] + [clarktown.matchers.empty-block :as empty-block])) + +(deftest empty-block-matcher-test + (testing "Checking an empty block" + (is (true? (empty-block/match? ""))) + (is (true? (empty-block/match? " "))))) \ No newline at end of file diff --git a/test/clarktown/matchers/horizontal_line_block_test.clj b/test/clarktown/matchers/horizontal_line_block_test.clj new file mode 100644 index 0000000..c3402d2 --- /dev/null +++ b/test/clarktown/matchers/horizontal_line_block_test.clj @@ -0,0 +1,14 @@ +(ns clarktown.matchers.horizontal-line-block-test + (:require + [clojure.test :refer [deftest testing is]] + [clarktown.matchers.horizontal-line-block :as horizontal-line-block])) + + +(deftest horizontal-line-block-matcher-test + (testing "Is a horizontal line block" + (is (true? (horizontal-line-block/match? "***"))) + (is (true? (horizontal-line-block/match? " ***"))) + (is (false? (horizontal-line-block/match? "Test *** 123"))) + (is (true? (horizontal-line-block/match? "---"))) + (is (true? (horizontal-line-block/match? " ---"))) + (is (false? (horizontal-line-block/match? "Test --- 123"))))) \ No newline at end of file diff --git a/test/clarktown/matchers/quote_block_test.clj b/test/clarktown/matchers/quote_block_test.clj new file mode 100644 index 0000000..05288d6 --- /dev/null +++ b/test/clarktown/matchers/quote_block_test.clj @@ -0,0 +1,11 @@ +(ns clarktown.matchers.quote-block-test + (:require + [clojure.test :refer [deftest testing is]] + [clarktown.matchers.quote-block :as quote-block])) + + +(deftest quote-block-block-matcher-test + (testing "Checking a quote block" + (is (true? (quote-block/match? "> Test"))) + (is (true? (quote-block/match? " > Test"))) + (is (true? (quote-block/match? ">"))))) \ No newline at end of file diff --git a/test/clarktown/parsers/bold_test.clj b/test/clarktown/parsers/bold_test.clj deleted file mode 100644 index a082d41..0000000 --- a/test/clarktown/parsers/bold_test.clj +++ /dev/null @@ -1,18 +0,0 @@ -(ns clarktown.parsers.bold-test - (:require - [clojure.test :refer [deftest testing is]] - [clarktown.parsers.bold :as bold])) - - -(deftest bold-test - (testing "Creating bold text with two surrounding asterisk characters" - (is (= "This is bold." - (bold/render "**This is bold.**" nil)))) - - (testing "Creating bold text with two surrounding underscore characters" - (is (= "This is bold." - (bold/render "__This is bold.__" nil)))) - - (testing "Creating bold text with both underscores and asterisks mixed" - (is (= "Hi, my name is John, what is your name?" - (bold/render "Hi, my name is **John**, what is __your name?__" nil))))) \ No newline at end of file diff --git a/test/clarktown/parsers/code_block_test.clj b/test/clarktown/parsers/code_block_test.clj deleted file mode 100644 index 8b1113d..0000000 --- a/test/clarktown/parsers/code_block_test.clj +++ /dev/null @@ -1,15 +0,0 @@ -(ns clarktown.parsers.code-block-test - (:require - [clojure.test :refer [deftest testing is]] - [clojure.java.io :as io] - [clarktown.parsers.code-block :as code-block])) - - -(deftest code-block-test - (testing "Code block with language specification" - (is (= (slurp (io/file (io/resource "test/parsers/code_block_result.html"))) - (code-block/render (slurp (io/file (io/resource "test/parsers/code_block.md"))) nil)))) - - (testing "Code block with NO language specification" - (is (= (slurp (io/file (io/resource "test/parsers/code_block_no_language_result.html"))) - (code-block/render (slurp (io/file (io/resource "test/parsers/code_block_no_language.md"))) nil))))) \ No newline at end of file diff --git a/test/clarktown/parsers/empty_block_test.clj b/test/clarktown/parsers/empty_block_test.clj deleted file mode 100644 index a8d89c4..0000000 --- a/test/clarktown/parsers/empty_block_test.clj +++ /dev/null @@ -1,14 +0,0 @@ -(ns clarktown.parsers.empty-block-test - (:require - [clojure.test :refer [deftest testing is]] - [clarktown.parsers.empty-block :as empty-block])) - - -(deftest empty-block-test - (testing "Rendering an empty block" - (is (= (empty-block/render "" nil) - ""))) - - (testing "Checking an empty block" - (is (true? (empty-block/is? ""))) - (is (true? (empty-block/is? " "))))) diff --git a/test/clarktown/parsers/heading_block_test.clj b/test/clarktown/parsers/heading_block_test.clj deleted file mode 100644 index 9bfff4f..0000000 --- a/test/clarktown/parsers/heading_block_test.clj +++ /dev/null @@ -1,44 +0,0 @@ -(ns clarktown.parsers.heading-block-test - (:require - [clojure.test :refer [deftest testing is]] - [clarktown.parsers.heading-block :as heading-block])) - - -(deftest hashbang-heading-test - (testing "Hashbang heading block that's a H1" - (is (= "

This is a heading block.

" - (heading-block/render "# This is a heading block." nil)))) - - (testing "Hashbang heading block that's a H2" - (is (= "

This is a heading block.

" - (heading-block/render "## This is a heading block." nil)))) - - (testing "Hashbang heading block that's a H3" - (is (= "

This is a heading block.

" - (heading-block/render "### This is a heading block." nil)))) - - (testing "Hashbang heading block that's a H4" - (is (= "

This is a heading block.

" - (heading-block/render "#### This is a heading block." nil)))) - - (testing "Hashbang heading block that's a H5" - (is (= "
This is a heading block.
" - (heading-block/render "##### This is a heading block." nil))))) - - -(deftest settext-heading-text - (testing "Settext heading block that's a H1" - (is (= "

This is a heading block.

" - (heading-block/render "This is a heading block.\n=========" nil)))) - - (testing "Settext heading block that's a H1 spanning multiple lines" - (is (= "

This is a \nheading block spanning multiple lines.

" - (heading-block/render "This is a \nheading block spanning multiple lines.\n========" nil)))) - - (testing "Settext heading block that's a H2" - (is (= "

This is a heading block.

" - (heading-block/render "This is a heading block.\n---------" nil)))) - - (testing "Settext heading block that's a H2 spanning multiple lines" - (is (= "

This is a \nheading block spanning multiple lines.

" - (heading-block/render "This is a \nheading block spanning multiple lines.\n--------" nil))))) \ No newline at end of file diff --git a/test/clarktown/parsers/horizontal_line_block_test.clj b/test/clarktown/parsers/horizontal_line_block_test.clj deleted file mode 100644 index 21617b6..0000000 --- a/test/clarktown/parsers/horizontal_line_block_test.clj +++ /dev/null @@ -1,21 +0,0 @@ -(ns clarktown.parsers.horizontal-line-block-test - (:require - [clojure.test :refer [deftest testing is]] - [clarktown.parsers.horizontal-line-block :as horizontal-line-block])) - - -(deftest horizontal-line-block-test - (testing "Creating a horizontal line" - (is (= "
" - (horizontal-line-block/render "***" nil))) - - (is (= "
" - (horizontal-line-block/render "---" nil)))) - - (testing "Is a horizontal line block" - (is (true? (horizontal-line-block/is? "***"))) - (is (true? (horizontal-line-block/is? " ***"))) - (is (false? (horizontal-line-block/is? "Test *** 123"))) - (is (true? (horizontal-line-block/is? "---"))) - (is (true? (horizontal-line-block/is? " ---"))) - (is (false? (horizontal-line-block/is? "Test --- 123"))))) \ No newline at end of file diff --git a/test/clarktown/parsers/inline_code_test.clj b/test/clarktown/parsers/inline_code_test.clj deleted file mode 100644 index 028c4b7..0000000 --- a/test/clarktown/parsers/inline_code_test.clj +++ /dev/null @@ -1,14 +0,0 @@ -(ns clarktown.parsers.inline-code-test - (:require - [clojure.test :refer [deftest testing is]] - [clarktown.parsers.inline-code :as inline-code])) - - -(deftest inline-code-test - (testing "Creating inline code text" - (is (= "This is inline code." - (inline-code/render "`This is inline code.`" nil)))) - - (testing "Creating inline-code text in the middle of regular text" - (is (= "This is regular text, mixed with some inline code., and it's great." - (inline-code/render "This is regular text, mixed with `some inline code.`, and it's great." nil))))) \ No newline at end of file diff --git a/test/clarktown/parsers/italic_test.clj b/test/clarktown/parsers/italic_test.clj deleted file mode 100644 index 8ab1369..0000000 --- a/test/clarktown/parsers/italic_test.clj +++ /dev/null @@ -1,18 +0,0 @@ -(ns clarktown.parsers.italic-test - (:require - [clojure.test :refer [deftest testing is]] - [clarktown.parsers.italic :as italic])) - - -(deftest italic-test - (testing "Creating italic text with one surrounding asterisk character" - (is (= "This is italic." - (italic/render "*This is italic.*" nil)))) - - (testing "Creating italic text with one surrounding underscore character" - (is (= "This is italic." - (italic/render "_This is italic._" nil)))) - - (testing "Creating italic text with both underscores and asterisks mixed" - (is (= "Hi, my name is John, what is your name?" - (italic/render "Hi, my name is *John*, what is _your name?_" nil))))) \ No newline at end of file diff --git a/test/clarktown/parsers/link_and_image_test.clj b/test/clarktown/parsers/link_and_image_test.clj deleted file mode 100644 index 348a8f9..0000000 --- a/test/clarktown/parsers/link_and_image_test.clj +++ /dev/null @@ -1,23 +0,0 @@ -(ns clarktown.parsers.link-and-image-test - (:require - [clojure.test :refer [deftest testing is]] - [clarktown.parsers.link-and-image :as link-and-image])) - - -(deftest link-test - (testing "Creating a link" - (is (= (link-and-image/render "[This is a link](https://example.com)" nil) - "This is a link")) - - (is (= (link-and-image/render "[This-is-a-link](https://example.com)" nil) - "This-is-a-link")) - - (is (= (link-and-image/render "[x] [label](link)" nil) - "[x] label")) - - (is (= (link-and-image/render "[ ] [label](link)" nil) - "[ ] label"))) - - (testing "Creating an image" - (is (= (link-and-image/render "![This is an image](https://example.com)" nil) - "\"This")))) \ No newline at end of file diff --git a/test/clarktown/parsers/quote_block_test.clj b/test/clarktown/parsers/quote_block_test.clj deleted file mode 100644 index 94553cf..0000000 --- a/test/clarktown/parsers/quote_block_test.clj +++ /dev/null @@ -1,15 +0,0 @@ -(ns clarktown.parsers.quote-block-test - (:require - [clojure.test :refer [deftest testing is]] - [clarktown.parsers.quote-block :as quote-block])) - - -(deftest quote-block-block-test - (testing "Creating a quote block line" - (is (= (quote-block/render "> First line\n> second line" nil) - "
First line\nsecond line
"))) - - (testing "Checking a quote block" - (is (true? (quote-block/is? "> Test"))) - (is (true? (quote-block/is? " > Test"))) - (is (true? (quote-block/is? ">"))))) \ No newline at end of file diff --git a/test/clarktown/parsers/strikethrough_test.clj b/test/clarktown/parsers/strikethrough_test.clj deleted file mode 100644 index fdf6188..0000000 --- a/test/clarktown/parsers/strikethrough_test.clj +++ /dev/null @@ -1,14 +0,0 @@ -(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 diff --git a/test/clarktown/renderers/bold_test.clj b/test/clarktown/renderers/bold_test.clj new file mode 100644 index 0000000..fba0ea6 --- /dev/null +++ b/test/clarktown/renderers/bold_test.clj @@ -0,0 +1,18 @@ +(ns clarktown.renderers.bold-test + (:require + [clojure.test :refer [deftest testing is]] + [clarktown.renderers.bold :as bold])) + + +(deftest bold-renderer-test + (testing "Creating bold text with two surrounding asterisk characters" + (is (= "This is bold." + (bold/render "**This is bold.**" nil)))) + + (testing "Creating bold text with two surrounding underscore characters" + (is (= "This is bold." + (bold/render "__This is bold.__" nil)))) + + (testing "Creating bold text with both underscores and asterisks mixed" + (is (= "Hi, my name is John, what is your name?" + (bold/render "Hi, my name is **John**, what is __your name?__" nil))))) \ No newline at end of file diff --git a/test/clarktown/renderers/code_block_test.clj b/test/clarktown/renderers/code_block_test.clj new file mode 100644 index 0000000..37c701b --- /dev/null +++ b/test/clarktown/renderers/code_block_test.clj @@ -0,0 +1,15 @@ +(ns clarktown.renderers.code-block-test + (:require + [clojure.test :refer [deftest testing is]] + [clojure.java.io :as io] + [clarktown.renderers.code-block :as code-block])) + + +(deftest code-block-renderer-test + (testing "Code block with language specification" + (is (= (slurp (io/file (io/resource "test/parsers/code_block_result.html"))) + (code-block/render (slurp (io/file (io/resource "test/parsers/code_block.md"))) nil)))) + + (testing "Code block with NO language specification" + (is (= (slurp (io/file (io/resource "test/parsers/code_block_no_language_result.html"))) + (code-block/render (slurp (io/file (io/resource "test/parsers/code_block_no_language.md"))) nil))))) \ No newline at end of file diff --git a/test/clarktown/renderers/empty_block_test.clj b/test/clarktown/renderers/empty_block_test.clj new file mode 100644 index 0000000..35fb902 --- /dev/null +++ b/test/clarktown/renderers/empty_block_test.clj @@ -0,0 +1,10 @@ +(ns clarktown.renderers.empty-block-test + (:require + [clojure.test :refer [deftest testing is]] + [clarktown.renderers.empty-block :as empty-block])) + + +(deftest empty-block-renderer-test + (testing "Rendering an empty block" + (is (= (empty-block/render "" nil) + "")))) diff --git a/test/clarktown/renderers/heading_block_test.clj b/test/clarktown/renderers/heading_block_test.clj new file mode 100644 index 0000000..9c3386f --- /dev/null +++ b/test/clarktown/renderers/heading_block_test.clj @@ -0,0 +1,44 @@ +(ns clarktown.renderers.heading-block-test + (:require + [clojure.test :refer [deftest testing is]] + [clarktown.renderers.heading-block :as heading-block])) + + +(deftest atx-heading-renderer-test + (testing "Hashbang heading block that's a H1" + (is (= "

This is a heading block.

" + (heading-block/render "# This is a heading block." nil)))) + + (testing "Hashbang heading block that's a H2" + (is (= "

This is a heading block.

" + (heading-block/render "## This is a heading block." nil)))) + + (testing "Hashbang heading block that's a H3" + (is (= "

This is a heading block.

" + (heading-block/render "### This is a heading block." nil)))) + + (testing "Hashbang heading block that's a H4" + (is (= "

This is a heading block.

" + (heading-block/render "#### This is a heading block." nil)))) + + (testing "Hashbang heading block that's a H5" + (is (= "
This is a heading block.
" + (heading-block/render "##### This is a heading block." nil))))) + + +(deftest settext-heading-renderer-text + (testing "Settext heading block that's a H1" + (is (= "

This is a heading block.

" + (heading-block/render "This is a heading block.\n=========" nil)))) + + (testing "Settext heading block that's a H1 spanning multiple lines" + (is (= "

This is a \nheading block spanning multiple lines.

" + (heading-block/render "This is a \nheading block spanning multiple lines.\n========" nil)))) + + (testing "Settext heading block that's a H2" + (is (= "

This is a heading block.

" + (heading-block/render "This is a heading block.\n---------" nil)))) + + (testing "Settext heading block that's a H2 spanning multiple lines" + (is (= "

This is a \nheading block spanning multiple lines.

" + (heading-block/render "This is a \nheading block spanning multiple lines.\n--------" nil))))) \ No newline at end of file diff --git a/test/clarktown/renderers/horizontal_line_block_test.clj b/test/clarktown/renderers/horizontal_line_block_test.clj new file mode 100644 index 0000000..db72682 --- /dev/null +++ b/test/clarktown/renderers/horizontal_line_block_test.clj @@ -0,0 +1,13 @@ +(ns clarktown.renderers.horizontal-line-block-test + (:require + [clojure.test :refer [deftest testing is]] + [clarktown.renderers.horizontal-line-block :as horizontal-line-block])) + + +(deftest horizontal-line-block-renderer-test + (testing "Creating a horizontal line" + (is (= (horizontal-line-block/render "***" nil) + "
")) + + (is (= (horizontal-line-block/render "---" nil) + "
")))) diff --git a/test/clarktown/renderers/inline_code_test.clj b/test/clarktown/renderers/inline_code_test.clj new file mode 100644 index 0000000..2071b7f --- /dev/null +++ b/test/clarktown/renderers/inline_code_test.clj @@ -0,0 +1,14 @@ +(ns clarktown.renderers.inline-code-test + (:require + [clojure.test :refer [deftest testing is]] + [clarktown.renderers.inline-code :as inline-code])) + + +(deftest inline-code-renderer-test + (testing "Creating inline code text" + (is (= "This is inline code." + (inline-code/render "`This is inline code.`" nil)))) + + (testing "Creating inline-code text in the middle of regular text" + (is (= "This is regular text, mixed with some inline code., and it's great." + (inline-code/render "This is regular text, mixed with `some inline code.`, and it's great." nil))))) \ No newline at end of file diff --git a/test/clarktown/renderers/italic_test.clj b/test/clarktown/renderers/italic_test.clj new file mode 100644 index 0000000..29e7811 --- /dev/null +++ b/test/clarktown/renderers/italic_test.clj @@ -0,0 +1,18 @@ +(ns clarktown.renderers.italic-test + (:require + [clojure.test :refer [deftest testing is]] + [clarktown.renderers.italic :as italic])) + + +(deftest italic-renderer-test + (testing "Creating italic text with one surrounding asterisk character" + (is (= "This is italic." + (italic/render "*This is italic.*" nil)))) + + (testing "Creating italic text with one surrounding underscore character" + (is (= "This is italic." + (italic/render "_This is italic._" nil)))) + + (testing "Creating italic text with both underscores and asterisks mixed" + (is (= "Hi, my name is John, what is your name?" + (italic/render "Hi, my name is *John*, what is _your name?_" nil))))) \ No newline at end of file diff --git a/test/clarktown/renderers/link_and_image_test.clj b/test/clarktown/renderers/link_and_image_test.clj new file mode 100644 index 0000000..aa821e3 --- /dev/null +++ b/test/clarktown/renderers/link_and_image_test.clj @@ -0,0 +1,23 @@ +(ns clarktown.renderers.link-and-image-test + (:require + [clojure.test :refer [deftest testing is]] + [clarktown.renderers.link-and-image :as link-and-image])) + + +(deftest link-renderer-test + (testing "Creating a link" + (is (= (link-and-image/render "[This is a link](https://example.com)" nil) + "This is a link")) + + (is (= (link-and-image/render "[This-is-a-link](https://example.com)" nil) + "This-is-a-link")) + + (is (= (link-and-image/render "[x] [label](link)" nil) + "[x] label")) + + (is (= (link-and-image/render "[ ] [label](link)" nil) + "[ ] label"))) + + (testing "Creating an image" + (is (= (link-and-image/render "![This is an image](https://example.com)" nil) + "\"This")))) \ No newline at end of file diff --git a/test/clarktown/renderers/quote_block_test.clj b/test/clarktown/renderers/quote_block_test.clj new file mode 100644 index 0000000..33a7495 --- /dev/null +++ b/test/clarktown/renderers/quote_block_test.clj @@ -0,0 +1,10 @@ +(ns clarktown.renderers.quote-block-test + (:require + [clojure.test :refer [deftest testing is]] + [clarktown.renderers.quote-block :as quote-block])) + + +(deftest quote-block-block-renderer-test + (testing "Creating a quote block line" + (is (= (quote-block/render "> First line\n> second line" nil) + "
First line\nsecond line
")))) \ No newline at end of file diff --git a/test/clarktown/renderers/strikethrough_test.clj b/test/clarktown/renderers/strikethrough_test.clj new file mode 100644 index 0000000..55493e0 --- /dev/null +++ b/test/clarktown/renderers/strikethrough_test.clj @@ -0,0 +1,14 @@ +(ns clarktown.renderers.strikethrough-test + (:require + [clojure.test :refer [deftest testing is]] + [clarktown.renderers.strikethrough :as strikethrough])) + + +(deftest strikethrough-renderer-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