diff --git a/src/Test.hs b/src/Test.hs index 40f6bef..60d2365 100644 --- a/src/Test.hs +++ b/src/Test.hs @@ -26,19 +26,35 @@ boldTests = check_equal "Should convert bold and italic in a sentence" "

It is a wonderful day

" (convert "It _is_ a __wonderful__ day") ] +linkTests = + TestList + [ check_equal "Should convert normal link" "

This is an example link.

" (convert "[This is an example link.](https://example.com)"), + check_equal "Should convert styled link" "

Fancy!!!

" (convert "[__Fancy__!!!](https://example.com)") + ] + +escapedCharTests = + TestList + [ check_equal "Should print literal underscore" "

This is an underscore - _

" (convert "This is an underscore - \\_"), + check_equal "Should print literal asterisk" "

This is an asterisk - *

" (convert "This is an asterisk - \\*"), + check_equal "Should print literal asterisk in bold" "

This is a bolded asterisk - *

" (convert "This is a bolded asterisk - **\\***") + ] + integrationTests = TestList [ check_equal "Integration 1" "

Sample Markdown

This is some basic, sample markdown.

Second Heading

" (convert "# Sample Markdown\n\n This is some basic, sample markdown.\n\n ## __Second__ _Heading_"), check_equal "Integration 2" "

Hello World

" (convert "__Hello__\n_World_"), check_equal "Integration 3" "

Hello

World

" (convert "# Hello\nWorld"), check_equal "Integration 4" "

a b

" (convert "a\nb"), - check_equal "Integration 5" "

Hello

" (convert "# Hello\n") + check_equal "Integration 5" "

Hello

" (convert "# Hello\n"), + check_equal "Integration 6" "

First line
Second line

" (convert "First line \nSecond line") ] tests = TestList [ headerTests, boldTests, + linkTests, + escapedCharTests, integrationTests ]