From 1c2804287a099b4ac2f6c2d9b3db452f7ef7bee1 Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Sat, 16 Feb 2013 12:59:38 +0100 Subject: Add a test for compiler/route ordering --- tests/Hakyll/Core/Runtime/Tests.hs | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'tests/Hakyll/Core/Runtime') diff --git a/tests/Hakyll/Core/Runtime/Tests.hs b/tests/Hakyll/Core/Runtime/Tests.hs index c68d99e..8a05824 100644 --- a/tests/Hakyll/Core/Runtime/Tests.hs +++ b/tests/Hakyll/Core/Runtime/Tests.hs @@ -20,7 +20,8 @@ import TestSuite.Util -------------------------------------------------------------------------------- tests :: Test -tests = testGroup "Hakyll.Core.Runtime.Tests" $ fromAssertions "run" [case01] +tests = testGroup "Hakyll.Core.Runtime.Tests" $ + fromAssertions "run" [case01, case02] -------------------------------------------------------------------------------- @@ -48,3 +49,22 @@ case01 = do head (lines bodies) @?= "This is an example." cleanTestEnv + + +-------------------------------------------------------------------------------- +case02 :: Assertion +case02 = do + _ <- run testConfiguration Logger.Error $ do + match "images/favicon.ico" $ do + route $ gsubRoute "images/" (const "") + compile $ makeItem ("Test" :: String) + + match "images/**" $ do + route idRoute + compile copyFileCompiler + + favicon <- readFile $ + destinationDirectory testConfiguration "favicon.ico" + favicon @?= "Test" + + cleanTestEnv -- cgit v1.2.3