diff options
author | Laurent P. René de Cotret <LaurentRDC@users.noreply.github.com> | 2021-05-30 15:00:59 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-30 22:00:59 +0300 |
commit | 6e77b4e7d2f74da964fd95494dad1ee56d4c4536 (patch) | |
tree | 2214049b8ed0366288e66cc22a3726e0a79b9670 /tests | |
parent | ef1e9b475cfd4886a01b0f26b9c4b30533fa7939 (diff) | |
download | hakyll-6e77b4e7d2f74da964fd95494dad1ee56d4c4536.tar.gz |
Async runtime with graph-based dependency cycle checks (#844)
* Async runtime
* Activate multi-threading in template repo
* Style changes after feedback
* Limiting the number of concurrent tasks
* Revert "Limiting the number of concurrent tasks"
This reverts commit 38984f6f5332632be8c4cab3e29d37e318492d70.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Hakyll/Core/Runtime/Tests.hs | 30 |
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 |