summaryrefslogtreecommitdiff
path: root/tests/Hakyll
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Hakyll')
-rw-r--r--tests/Hakyll/Core/Identifier/Tests.hs13
-rw-r--r--tests/Hakyll/Core/Runtime/Tests.hs9
2 files changed, 17 insertions, 5 deletions
diff --git a/tests/Hakyll/Core/Identifier/Tests.hs b/tests/Hakyll/Core/Identifier/Tests.hs
index b477a7c..a31b424 100644
--- a/tests/Hakyll/Core/Identifier/Tests.hs
+++ b/tests/Hakyll/Core/Identifier/Tests.hs
@@ -6,6 +6,7 @@ module Hakyll.Core.Identifier.Tests
--------------------------------------------------------------------------------
+import Data.Monoid (mappend, mempty)
import Test.Framework (Test, testGroup)
import Test.HUnit ((@=?))
@@ -19,12 +20,22 @@ import TestSuite.Util
--------------------------------------------------------------------------------
tests :: Test
tests = testGroup "Hakyll.Core.Identifier.Tests" $ concat
- [ captureTests
+ [ isLiteralTests
+ , captureTests
, matchesTests
]
--------------------------------------------------------------------------------
+isLiteralTests :: [Test]
+isLiteralTests = fromAssertions "isLiteral"
+ [ Just "index.html" @=? fromLiteral "index.html"
+ , Nothing @=? fromLiteral "posts/*.markdown"
+ , Just "test.txt" @=? fromLiteral ("test.txt" `mappend` mempty)
+ ]
+
+
+--------------------------------------------------------------------------------
captureTests :: [Test]
captureTests = fromAssertions "capture"
[ Just ["bar"] @=? capture "foo/**" "foo/bar"
diff --git a/tests/Hakyll/Core/Runtime/Tests.hs b/tests/Hakyll/Core/Runtime/Tests.hs
index 0d202c7..38eb5f5 100644
--- a/tests/Hakyll/Core/Runtime/Tests.hs
+++ b/tests/Hakyll/Core/Runtime/Tests.hs
@@ -33,10 +33,11 @@ case01 = withTestConfiguration $ \config -> do
saveSnapshot "raw" body
return $ renderPandoc body
- match "bodies.txt" $ route idRoute
- create "bodies.txt" $ do
- items <- requireAllSnapshots "*.md" "raw" :: Compiler [Item String]
- makeItem $ concat $ map itemBody items
+ match "bodies.txt" $ do
+ route idRoute
+ compile $ do
+ items <- requireAllSnapshots "*.md" "raw"
+ makeItem $ concat $ map itemBody (items :: [Item String])
example <- readFile $ destinationDirectory config </> "example.html"
lines example @?= ["<p>This is an example.</p>"]