summaryrefslogtreecommitdiff
path: root/tests/Tests.hs
diff options
context:
space:
mode:
authorJasper Van der Jeugt <jaspervdj@gmail.com>2010-01-09 21:40:31 +0100
committerJasper Van der Jeugt <jaspervdj@gmail.com>2010-01-09 21:40:31 +0100
commit73f6b1ab8cf3cb9468c547db6df1df9596f1470d (patch)
tree1d8b7205cc88388573c50798dd6e16effeb39ece /tests/Tests.hs
parentcb3e3b119313145b5b79d46d2c40390ce9d9a51b (diff)
downloadhakyll-73f6b1ab8cf3cb9468c547db6df1df9596f1470d.tar.gz
Some changes to the regex interface, and version bump.
Diffstat (limited to 'tests/Tests.hs')
-rw-r--r--tests/Tests.hs15
1 files changed, 9 insertions, 6 deletions
diff --git a/tests/Tests.hs b/tests/Tests.hs
index 3c2cb1e..e3cada6 100644
--- a/tests/Tests.hs
+++ b/tests/Tests.hs
@@ -10,6 +10,7 @@ import qualified Data.ByteString.Lazy.Char8 as B
import Text.Hakyll.CompressCSS
import Text.Hakyll.Util
+import Text.Hakyll.Regex
import Text.Hakyll.Context
import Text.Hakyll.File
@@ -21,12 +22,14 @@ tests = [ testGroup "Util group" [ testProperty "trim length" prop_trim_length
, testCase "stripHTML 1" test_strip_html1
, testCase "stripHTML 2" test_strip_html2
, testCase "stripHTML 3" test_strip_html3
- , testCase "split 1" test_split1
- , testCase "split 2" test_split2
, testCase "link 1" test_link1
, testCase "link 2" test_link2
]
+ , testGroup "Regex group" [ testCase "split 1" test_split1
+ , testCase "split 2" test_split2
+ ]
+
, testGroup "CompressCSS group" [ testProperty "compressCSS length" prop_compress_css_length
, testCase "compressCSS 1" test_compress_css1
, testCase "compressCSS 2" test_compress_css2
@@ -61,14 +64,14 @@ test_strip_html2 = stripHTML "text" @?= "text"
test_strip_html3 = stripHTML "<b>Hakyll</b> is an <i>awesome</i> web framework <img src=\"foo.png\" />" @?=
"Hakyll is an awesome web framework "
--- Split test cases.
-test_split1 = split "," "1,2,3" @?= ["1", "2", "3"]
-test_split2 = split "," ",1,2," @?= ["1", "2"]
-
-- Link test cases.
test_link1 = link "foo bar" "/foo/bar.html" @?= "<a href=\"/foo/bar.html\">foo bar</a>"
test_link2 = link "back home" "/" @?= "<a href=\"/\">back home</a>"
+-- Split test cases.
+test_split1 = split "," "1,2,3" @?= ["1", "2", "3"]
+test_split2 = split "," ",1,2," @?= ["1", "2"]
+
-- CSS compression should always decrease the text length.
prop_compress_css_length str = length str >= length (compressCSS str)