diff options
| author | Asko Nomm <asko@bien.ee> | 2022-04-09 13:51:16 +0200 |
|---|---|---|
| committer | Asko Nomm <asko@bien.ee> | 2022-04-09 13:51:16 +0200 |
| commit | 9f8f4fc36adef06458320d7bfdef01dbe41f52a1 (patch) | |
| tree | 48b51c46809dedb79f5891e113443a4dec028921 /test/clarktown | |
| parent | 7055c7bd45c5156df61ab3a77b8e22a037f04408 (diff) | |
Support settext headings (closes #6)
Diffstat (limited to 'test/clarktown')
| -rw-r--r-- | test/clarktown/parsers/heading_block_test.clj | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/test/clarktown/parsers/heading_block_test.clj b/test/clarktown/parsers/heading_block_test.clj new file mode 100644 index 0000000..9bfff4f --- /dev/null +++ b/test/clarktown/parsers/heading_block_test.clj @@ -0,0 +1,44 @@ +(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 (= "<h1>This is a heading block.</h1>" + (heading-block/render "# This is a heading block." nil)))) + + (testing "Hashbang heading block that's a H2" + (is (= "<h2>This is a heading block.</h2>" + (heading-block/render "## This is a heading block." nil)))) + + (testing "Hashbang heading block that's a H3" + (is (= "<h3>This is a heading block.</h3>" + (heading-block/render "### This is a heading block." nil)))) + + (testing "Hashbang heading block that's a H4" + (is (= "<h4>This is a heading block.</h4>" + (heading-block/render "#### This is a heading block." nil)))) + + (testing "Hashbang heading block that's a H5" + (is (= "<h5>This is a heading block.</h5>" + (heading-block/render "##### This is a heading block." nil))))) + + +(deftest settext-heading-text + (testing "Settext heading block that's a H1" + (is (= "<h1>This is a heading block.</h1>" + (heading-block/render "This is a heading block.\n=========" nil)))) + + (testing "Settext heading block that's a H1 spanning multiple lines" + (is (= "<h1>This is a \nheading block spanning multiple lines.</h1>" + (heading-block/render "This is a \nheading block spanning multiple lines.\n========" nil)))) + + (testing "Settext heading block that's a H2" + (is (= "<h2>This is a heading block.</h2>" + (heading-block/render "This is a heading block.\n---------" nil)))) + + (testing "Settext heading block that's a H2 spanning multiple lines" + (is (= "<h2>This is a \nheading block spanning multiple lines.</h2>" + (heading-block/render "This is a \nheading block spanning multiple lines.\n--------" nil)))))
\ No newline at end of file |
