diff options
| author | Asko Nõmm <84135165+askonomm@users.noreply.github.com> | 2022-04-23 02:43:49 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-04-23 02:43:49 +0300 |
| commit | 70d88384ea788f7b2ad5ebb725762f7d27300504 (patch) | |
| tree | b371f12617949daf2b40538ba9a2e4457b657d0f /test/clarktown/parsers | |
| parent | 059bfa7bd9bfdde0c75646bf1dfc20d23da8a02c (diff) | |
| parent | dc921cbe1c786995a8670efd9f5556ee9df064f9 (diff) | |
Merge pull request #17 from askonomm/16-improve-architecture
Improve architecture
Diffstat (limited to 'test/clarktown/parsers')
| -rw-r--r-- | test/clarktown/parsers/bold_test.clj | 18 | ||||
| -rw-r--r-- | test/clarktown/parsers/code_block_test.clj | 15 | ||||
| -rw-r--r-- | test/clarktown/parsers/empty_block_test.clj | 14 | ||||
| -rw-r--r-- | test/clarktown/parsers/heading_block_test.clj | 44 | ||||
| -rw-r--r-- | test/clarktown/parsers/horizontal_line_block_test.clj | 21 | ||||
| -rw-r--r-- | test/clarktown/parsers/inline_code_test.clj | 14 | ||||
| -rw-r--r-- | test/clarktown/parsers/italic_test.clj | 18 | ||||
| -rw-r--r-- | test/clarktown/parsers/link_and_image_test.clj | 23 | ||||
| -rw-r--r-- | test/clarktown/parsers/quote_block_test.clj | 15 | ||||
| -rw-r--r-- | test/clarktown/parsers/strikethrough_test.clj | 14 |
10 files changed, 0 insertions, 196 deletions
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 (= "<strong>This is bold.</strong>" - (bold/render "**This is bold.**" nil)))) - - (testing "Creating bold text with two surrounding underscore characters" - (is (= "<strong>This is bold.</strong>" - (bold/render "__This is bold.__" nil)))) - - (testing "Creating bold text with both underscores and asterisks mixed" - (is (= "Hi, my name is <strong>John</strong>, what is <strong>your name?</strong>" - (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 (= "<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 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 (= "<hr>" - (horizontal-line-block/render "***" nil))) - - (is (= "<hr>" - (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 (= "<code>This is inline code.</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 <code>some inline code.</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 (= "<em>This is italic.</em>" - (italic/render "*This is italic.*" nil)))) - - (testing "Creating italic text with one surrounding underscore character" - (is (= "<em>This is italic.</em>" - (italic/render "_This is italic._" nil)))) - - (testing "Creating italic text with both underscores and asterisks mixed" - (is (= "Hi, my name is <em>John</em>, what is <em>your name?</em>" - (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) - "<a href=\"https://example.com\">This is a link</a>")) - - (is (= (link-and-image/render "[This-is-a-link](https://example.com)" nil) - "<a href=\"https://example.com\">This-is-a-link</a>")) - - (is (= (link-and-image/render "[x] [label](link)" nil) - "[x] <a href=\"link\">label</a>")) - - (is (= (link-and-image/render "[ ] [label](link)" nil) - "[ ] <a href=\"link\">label</a>"))) - - (testing "Creating an image" - (is (= (link-and-image/render "" nil) - "<img src=\"https://example.com\" alt=\"This is an image\">"))))
\ 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) - "<blockquote>First line\nsecond line</blockquote>"))) - - (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) - "<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 |
