Split package into library module 'src' and executable 'app'

This commit is contained in:
2025-05-02 10:30:08 -04:00
parent 626eb71097
commit d63cd98288
3 changed files with 173 additions and 115 deletions

22
src/Test.hs Normal file
View File

@@ -0,0 +1,22 @@
module MdToHtmlTest where
import MdToHTML
import Test.HUnit
headerTests = TestList
[
(TestCase (assertEqual "Should convert H1 heading" "<h1>Hello</h1>" (show . fst $ leftmostLongestParse parseLine "# Hello"))),
(TestCase (assertEqual "Should convert H2 heading" "<h2>Hello</h2>" (show . fst $ leftmostLongestParse parseLine "## Hello"))),
(TestCase (assertEqual "Should convert H3 heading" "<h3>Hello</h3>" (show . fst $ leftmostLongestParse parseLine "### Hello"))),
(TestCase (assertEqual "Should convert H4 heading" "<h4>Hello</h4>" (show . fst $ leftmostLongestParse parseLine "#### Hello"))),
(TestCase (assertEqual "Should convert H5 heading" "<h5>Hello</h5>" (show . fst $ leftmostLongestParse parseLine "##### Hello"))),
(TestCase (assertEqual "Should convert H6 heading" "<h6>Hello</h6>" (show . fst $ leftmostLongestParse parseLine "###### Hello")))
]
tests = TestList
[
headerTests
]
runTests = runTestTT tests