on master help sign in
Added test case for non-metadata pages.
commit417a9a92d856f7efae6b41d354aab87f575e4b9f authorJasper Van der Jeugt <jaspervdj@gmail.com> dateThu 1 Apr 2010, 12:26 (17 years ago) parent1a8f00e
1 file changed+9
tests/Page.hs+9
tests/Page.hs+9
@@ -22,6 +22,7 @@ import Text.Hakyll
2222pageGroup = testGroup "Page"
2323 [ testCase "test_readPage_1" test_readPage_1
2424 , testCase "test_readPage_2" test_readPage_2
25+ , testCase "test_readPage_3" test_readPage_3
2526 ]
2627
2728-- | An abstract function to test page reading.
@@ -59,3 +60,11 @@ test_readPage_2 = test_readPage fileName content assertion @? "test_readPage_2"
5960 ]
6061 assertion page = M.lookup "someSection" page == Just "This is a section.\n"
6162 && M.lookup "body" page == Just "This is the body.\n"
63+
64+-- | readPage test case 3.
65+test_readPage_3 = test_readPage fileName content assertion @? "test_readPage_3"
66+ where
67+ fileName = "test_readPage_3.txt"
68+ content = unlines [ "No metadata here, sorry."
69+ ]
70+ assertion page = M.lookup "body" page == Just "No metadata here, sorry.\n"