summaryrefslogtreecommitdiff
path: root/tests/Hakyll/Core/Runtime/Tests.hs
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2021-07-17 20:19:28 +0200
committerIgor Pashev <pashev.igor@gmail.com>2021-07-17 20:19:28 +0200
commit8ce817dd4453f35ce92afa531c540554429c7299 (patch)
tree90236cdc7e59bdf99b32467b89adcb8c5a0b8e22 /tests/Hakyll/Core/Runtime/Tests.hs
parentb861c20ff2d7460061e73492e3a945e48ef40bac (diff)
parentd739fd1eea40de9ded3b4f682c849d3c31eba92c (diff)
downloadhakyll-8ce817dd4453f35ce92afa531c540554429c7299.tar.gz
Merge branch 'master' of https://github.com/jaspervdj/hakyll
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