summaryrefslogtreecommitdiff
path: root/tests/Hakyll/Web
diff options
context:
space:
mode:
authorJasper Van der Jeugt <jaspervdj@gmail.com>2011-02-09 19:28:53 +0100
committerJasper Van der Jeugt <jaspervdj@gmail.com>2011-02-09 19:28:53 +0100
commitd9e0c3e86b03834a03e7ddf37b70cc141eccfe1c (patch)
tree588592f8112fa4380fb4703095e4bf5c4d7f2d0f /tests/Hakyll/Web
parent002cf4de32db979d515c2a9cdcd8c8f42859a797 (diff)
downloadhakyll-d9e0c3e86b03834a03e7ddf37b70cc141eccfe1c.tar.gz
Some tests for the Page module
Diffstat (limited to 'tests/Hakyll/Web')
-rw-r--r--tests/Hakyll/Web/Page/Tests.hs35
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/Hakyll/Web/Page/Tests.hs b/tests/Hakyll/Web/Page/Tests.hs
new file mode 100644
index 0000000..14f3d7e
--- /dev/null
+++ b/tests/Hakyll/Web/Page/Tests.hs
@@ -0,0 +1,35 @@
+{-# LANGUAGE OverloadedStrings #-}
+module Hakyll.Web.Page.Tests
+ ( tests
+ ) where
+
+import Test.Framework
+import Test.Framework.Providers.HUnit
+import Test.HUnit hiding (Test)
+
+import qualified Data.Map as M
+
+import Hakyll.Web.Page
+import Hakyll.Web.Page.Internal
+import Hakyll.Web.Page.Read
+import TestSuite.Util
+
+tests :: [Test]
+tests = fromAssertions "applyTemplate"
+ -- Hakyll templates
+ [ Page (M.singleton "foo" "bar") "body\n" @=? readPage
+ "--- \n\
+ \foo: bar \n\
+ \--- \n\
+ \body"
+
+ , Page M.empty "line one\nlijn twee\n" @=? readPage
+ "line one\n\
+ \lijn twee"
+
+ , Page (M.fromList [("field1", "unos"), ("veld02", "deux")]) "" @=? readPage
+ "---\n\
+ \veld02: deux\n\
+ \field1: unos\n\
+ \---"
+ ]