summaryrefslogtreecommitdiff
path: root/tests/Hakyll
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Hakyll')
-rw-r--r--tests/Hakyll/Core/Route/Tests.hs25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/Hakyll/Core/Route/Tests.hs b/tests/Hakyll/Core/Route/Tests.hs
new file mode 100644
index 0000000..17a4123
--- /dev/null
+++ b/tests/Hakyll/Core/Route/Tests.hs
@@ -0,0 +1,25 @@
+{-# LANGUAGE OverloadedStrings #-}
+module Hakyll.Core.Route.Tests
+ ( tests
+ ) where
+
+import Test.Framework
+import Test.Framework.Providers.HUnit
+import Test.HUnit hiding (Test)
+
+import Hakyll.Core.Route
+
+tests :: [Test]
+tests = zipWith testCase names matchCases
+ where
+ names = map (\n -> "runRoute [" ++ show n ++ "]") [1 :: Int ..]
+
+-- | Collection of simple cases
+--
+matchCases :: [Assertion]
+matchCases =
+ [ Just "foo.html" @=? runRoute (setExtension "html") "foo"
+ , Just "foo.html" @=? runRoute (setExtension ".html") "foo"
+ , Just "foo.html" @=? runRoute (setExtension "html") "foo.markdown"
+ , Just "foo.html" @=? runRoute (setExtension ".html") "foo.markdown"
+ ]