From 417a9a92d856f7efae6b41d354aab87f575e4b9f Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Thu, 1 Apr 2010 12:26:31 +0200 Subject: Added test case for non-metadata pages. --- tests/Page.hs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/Page.hs b/tests/Page.hs index 1eb8e86..ae1fcd9 100644 --- a/tests/Page.hs +++ b/tests/Page.hs @@ -22,6 +22,7 @@ import Text.Hakyll pageGroup = testGroup "Page" [ testCase "test_readPage_1" test_readPage_1 , testCase "test_readPage_2" test_readPage_2 + , testCase "test_readPage_3" test_readPage_3 ] -- | An abstract function to test page reading. @@ -59,3 +60,11 @@ test_readPage_2 = test_readPage fileName content assertion @? "test_readPage_2" ] assertion page = M.lookup "someSection" page == Just "This is a section.\n" && M.lookup "body" page == Just "This is the body.\n" + +-- | readPage test case 3. +test_readPage_3 = test_readPage fileName content assertion @? "test_readPage_3" + where + fileName = "test_readPage_3.txt" + content = unlines [ "No metadata here, sorry." + ] + assertion page = M.lookup "body" page == Just "No metadata here, sorry.\n" -- cgit v1.2.3