@@ -10,6 +10,7 @@ import qualified Data.ByteString.Lazy.Char8 as B
11import Text.Hakyll.CompressCSS
11import Text.Hakyll.CompressCSS
12import Text.Hakyll.Util
12import Text.Hakyll.Util
13+import Text.Hakyll.Regex
13import Text.Hakyll.Context
14import Text.Hakyll.Context
14import Text.Hakyll.File
15import Text.Hakyll.File
@@ -21,12 +22,14 @@ tests = [ testGroup "Util group" [ testProperty "trim length" prop_trim_length
21 , testCase "stripHTML 1" test_strip_html1
22 , testCase "stripHTML 1" test_strip_html1
22 , testCase "stripHTML 2" test_strip_html2
23 , testCase "stripHTML 2" test_strip_html2
23 , testCase "stripHTML 3" test_strip_html3
24 , testCase "stripHTML 3" test_strip_html3
24− , testCase "split 1" test_split1
25− , testCase "split 2" test_split2
26 , testCase "link 1" test_link1
25 , testCase "link 1" test_link1
27 , testCase "link 2" test_link2
26 , testCase "link 2" test_link2
29+ , testGroup "Regex group" [ testCase "split 1" test_split1
30+ , testCase "split 2" test_split2
30 , testGroup "CompressCSS group" [ testProperty "compressCSS length" prop_compress_css_length
33 , testGroup "CompressCSS group" [ testProperty "compressCSS length" prop_compress_css_length
31 , testCase "compressCSS 1" test_compress_css1
34 , testCase "compressCSS 1" test_compress_css1
32 , testCase "compressCSS 2" test_compress_css2
35 , testCase "compressCSS 2" test_compress_css2
@@ -61,14 +64,14 @@ test_strip_html2 = stripHTML "text" @?= "text"
61test_strip_html3 = stripHTML "<b>Hakyll</b> is an <i>awesome</i> web framework <img src=\"foo.png\" />" @?=
64test_strip_html3 = stripHTML "<b>Hakyll</b> is an <i>awesome</i> web framework <img src=\"foo.png\" />" @?=
62 "Hakyll is an awesome web framework "
65 "Hakyll is an awesome web framework "
65−test_split1 = split "," "1,2,3" @?= ["1", "2", "3"]
66−test_split2 = split "," ",1,2," @?= ["1", "2"]
68-- Link test cases.
67-- Link test cases.
69test_link1 = link "foo bar" "/foo/bar.html" @?= "<a href=\"/foo/bar.html\">foo bar</a>"
68test_link1 = link "foo bar" "/foo/bar.html" @?= "<a href=\"/foo/bar.html\">foo bar</a>"
70test_link2 = link "back home" "/" @?= "<a href=\"/\">back home</a>"
69test_link2 = link "back home" "/" @?= "<a href=\"/\">back home</a>"
72+test_split1 = split "," "1,2,3" @?= ["1", "2", "3"]
73+test_split2 = split "," ",1,2," @?= ["1", "2"]
72-- CSS compression should always decrease the text length.
75-- CSS compression should always decrease the text length.
73prop_compress_css_length str = length str >= length (compressCSS str)
76prop_compress_css_length str = length str >= length (compressCSS str)