summaryrefslogtreecommitdiff
path: root/tests/Hakyll/Core/Runtime/Tests.hs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Hakyll/Core/Runtime/Tests.hs')
-rw-r--r--tests/Hakyll/Core/Runtime/Tests.hs30
1 files changed, 29 insertions, 1 deletions
diff --git a/tests/Hakyll/Core/Runtime/Tests.hs b/tests/Hakyll/Core/Runtime/Tests.hs
index 9c23162..615aaf2 100644
--- a/tests/Hakyll/Core/Runtime/Tests.hs
+++ b/tests/Hakyll/Core/Runtime/Tests.hs
@@ -8,6 +8,7 @@ module Hakyll.Core.Runtime.Tests
--------------------------------------------------------------------------------
import qualified Data.ByteString as B
import System.FilePath ((</>))
+import System.Exit (ExitCode (..))
import Test.Tasty (TestTree, testGroup)
import Test.Tasty.HUnit (Assertion, (@?=))
@@ -22,7 +23,7 @@ import TestSuite.Util
--------------------------------------------------------------------------------
tests :: TestTree
tests = testGroup "Hakyll.Core.Runtime.Tests" $
- fromAssertions "run" [case01, case02]
+ fromAssertions "run" [case01, case02, case03]
--------------------------------------------------------------------------------
@@ -94,3 +95,30 @@ case02 = do
favicon @?= "Test"
cleanTestEnv
+
+
+--------------------------------------------------------------------------------
+-- Test that dependency cycles are correctly identified
+case03 :: Assertion
+case03 = do
+ logger <- Logger.new Logger.Error
+ (ec, _) <- run testConfiguration logger $ do
+
+ create ["partial.html.out1"] $ do
+ route idRoute
+ compile $ do
+ example <- loadSnapshotBody "partial.html.out2" "raw"
+ makeItem example
+ >>= loadAndApplyTemplate "partial.html" defaultContext
+
+ create ["partial.html.out2"] $ do
+ route idRoute
+ compile $ do
+ example <- loadSnapshotBody "partial.html.out1" "raw"
+ makeItem example
+ >>= loadAndApplyTemplate "partial.html" defaultContext
+
+
+ ec @?= ExitFailure 1
+
+ cleanTestEnv