hakyll/tests/Hakyll/Web/Page/Tests.hs

41 lines
907 B
Haskell
Raw Normal View History

2011-02-09 18:28:53 +00:00
{-# LANGUAGE OverloadedStrings #-}
module Hakyll.Web.Page.Tests
( tests
) where
import Test.Framework
import Test.HUnit hiding (Test)
import qualified Data.Map as M
import Hakyll.Web.Page
import Hakyll.Web.Page.Read
import TestSuite.Util
tests :: [Test]
2011-02-09 18:57:25 +00:00
tests = fromAssertions "readPage"
2011-07-18 16:47:11 +00:00
[ Page (M.singleton "foo" "bar") "body" @=? readPage
2011-02-09 18:28:53 +00:00
"--- \n\
\foo: bar \n\
\--- \n\
\body"
2011-07-18 16:47:11 +00:00
, Page M.empty "line one\nlijn twee" @=? readPage
2011-02-09 18:28:53 +00:00
"line one\n\
\lijn twee"
, Page (M.fromList [("field1", "unos"), ("veld02", "deux")]) "" @=? readPage
"---\n\
\veld02: deux\n\
\field1: unos\n\
2011-07-18 16:47:11 +00:00
\---\n"
, Page (M.fromList [("author", "jasper"), ("title", "lol")]) "O hai\n"
@=? readPage
"---\n\
\author: jasper\n\
\title: lol\n\
\...\n\
\O hai\n"
2011-02-09 18:28:53 +00:00
]