@@ -10,6 +10,7 @@ import qualified Data.ByteString.Lazy.Char8 as B
1010
1111import Text.Hakyll.CompressCSS
1212import Text.Hakyll.Util
13+import Text.Hakyll.Regex
1314import Text.Hakyll.Context
1415import Text.Hakyll.File
1516
@@ -21,12 +22,14 @@ tests = [ testGroup "Util group" [ testProperty "trim length" prop_trim_length
2122 , testCase "stripHTML 1" test_strip_html1
2223 , testCase "stripHTML 2" test_strip_html2
2324 , testCase "stripHTML 3" test_strip_html3
24− , testCase "split 1" test_split1
25− , testCase "split 2" test_split2
2625 , testCase "link 1" test_link1
2726 , testCase "link 2" test_link2
2827 ]
2928
29+ , testGroup "Regex group" [ testCase "split 1" test_split1
30+ , testCase "split 2" test_split2
31+ ]
32+
3033 , testGroup "CompressCSS group" [ testProperty "compressCSS length" prop_compress_css_length
3134 , testCase "compressCSS 1" test_compress_css1
3235 , testCase "compressCSS 2" test_compress_css2
@@ -61,14 +64,14 @@ test_strip_html2 = stripHTML "text" @?= "text"
6164test_strip_html3 = stripHTML "<b>Hakyll</b> is an <i>awesome</i> web framework <img src=\"foo.png\" />" @?=
6265 "Hakyll is an awesome web framework "
6366
64−-- Split test cases.
65−test_split1 = split "," "1,2,3" @?= ["1", "2", "3"]
66−test_split2 = split "," ",1,2," @?= ["1", "2"]
67−
6867-- Link test cases.
6968test_link1 = link "foo bar" "/foo/bar.html" @?= "<a href=\"/foo/bar.html\">foo bar</a>"
7069test_link2 = link "back home" "/" @?= "<a href=\"/\">back home</a>"
7170
71+-- Split test cases.
72+test_split1 = split "," "1,2,3" @?= ["1", "2", "3"]
73+test_split2 = split "," ",1,2," @?= ["1", "2"]
74+
7275-- CSS compression should always decrease the text length.
7376prop_compress_css_length str = length str >= length (compressCSS str)
7477