Added more tests
This commit is contained in:
11
src/Test.hs
11
src/Test.hs
@@ -3,6 +3,8 @@ module MdToHtmlTest where
|
|||||||
import MdToHTML
|
import MdToHTML
|
||||||
import Test.HUnit
|
import Test.HUnit
|
||||||
|
|
||||||
|
check_equal expected actual
|
||||||
|
|
||||||
headerTests = TestList
|
headerTests = TestList
|
||||||
[
|
[
|
||||||
(TestCase (assertEqual "Should convert H1 heading" "<h1>Hello</h1>" (show . fst $ leftmostLongestParse parseLine "# Hello"))),
|
(TestCase (assertEqual "Should convert H1 heading" "<h1>Hello</h1>" (show . fst $ leftmostLongestParse parseLine "# Hello"))),
|
||||||
@@ -13,10 +15,17 @@ headerTests = TestList
|
|||||||
(TestCase (assertEqual "Should convert H6 heading" "<h6>Hello</h6>" (show . fst $ leftmostLongestParse parseLine "###### Hello")))
|
(TestCase (assertEqual "Should convert H6 heading" "<h6>Hello</h6>" (show . fst $ leftmostLongestParse parseLine "###### Hello")))
|
||||||
]
|
]
|
||||||
|
|
||||||
|
boldTests = TestList
|
||||||
|
[
|
||||||
|
(TestCase (assertEqual "Should convert bold" "<b>Hello</b>" (show . fst $ leftmostLongestParse parseLine "__Hello__"))),
|
||||||
|
(TestCase (assertEqual "Should convert italic" "<i>Hello</i>" (show . fst $ leftmostLongestParse parseLine "_Hello_"))),
|
||||||
|
(TestCase (assertEqual "Should convert bold and italic in a sentence" "It <i>is</i> a <b>wonderful</b> day" (show . fst $ leftmostLongestParse parseLine "It _is_ a __wonderful__ day")))
|
||||||
|
]
|
||||||
|
|
||||||
tests = TestList
|
tests = TestList
|
||||||
[
|
[
|
||||||
headerTests
|
headerTests,
|
||||||
|
boldTests
|
||||||
]
|
]
|
||||||
|
|
||||||
runTests = runTestTT tests
|
runTests = runTestTT tests
|
||||||
|
Reference in New Issue
Block a user