module MdToHtmlTest where import MdToHTML import Test.HUnit check_equal :: String -> String -> String -> Test check_equal desc expected actual = TestCase (assertEqual desc expected actual) convert :: String -> String convert md = show . fst $ leftmostLongestParse parseDocument md headerTests = TestList [ check_equal "Should convert H1 heading" "
Hello
" (convert "__Hello__"), check_equal "Should convert italic" "Hello
" (convert "_Hello_"), check_equal "Should convert bold and italic in a sentence" "It is a wonderful day
" (convert "It _is_ a __wonderful__ day") ] integrationTests = TestList [ check_equal "Integration 1" "This is some basic, sample markdown.
Hello World
" (convert "__Hello__\n_World_"), check_equal "Integration 3" "World
" (convert "# Hello\nWorld"), check_equal "Integration 4" "