From 4bdd93b331eec642873262a524b6b3a6132eb1c9 Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Thu, 23 Dec 2010 19:20:05 +0100 Subject: Add Route code --- tests/Hakyll/Core/Route/Tests.hs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 tests/Hakyll/Core/Route/Tests.hs (limited to 'tests/Hakyll') 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" + ] -- cgit v1.2.3