From e51d16a39b0f7824366101f76a722f98347cc7ed Mon Sep 17 00:00:00 2001 From: Aadhavan Srinivasan Date: Fri, 2 May 2025 10:59:20 -0400 Subject: [PATCH] Added more tests --- src/Test.hs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Test.hs b/src/Test.hs index e4333d1..28c627b 100644 --- a/src/Test.hs +++ b/src/Test.hs @@ -3,6 +3,8 @@ module MdToHtmlTest where import MdToHTML import Test.HUnit +check_equal expected actual + headerTests = TestList [ (TestCase (assertEqual "Should convert H1 heading" "

Hello

" (show . fst $ leftmostLongestParse parseLine "# Hello"))), @@ -13,10 +15,17 @@ headerTests = TestList (TestCase (assertEqual "Should convert H6 heading" "
Hello
" (show . fst $ leftmostLongestParse parseLine "###### Hello"))) ] +boldTests = TestList + [ + (TestCase (assertEqual "Should convert bold" "Hello" (show . fst $ leftmostLongestParse parseLine "__Hello__"))), + (TestCase (assertEqual "Should convert italic" "Hello" (show . fst $ leftmostLongestParse parseLine "_Hello_"))), + (TestCase (assertEqual "Should convert bold and italic in a sentence" "It is a wonderful day" (show . fst $ leftmostLongestParse parseLine "It _is_ a __wonderful__ day"))) + ] tests = TestList [ - headerTests + headerTests, + boldTests ] runTests = runTestTT tests