summaryrefslogtreecommitdiff
path: root/tests/Hakyll/Core
diff options
context:
space:
mode:
authorLaurent P. René de Cotret <LaurentRDC@users.noreply.github.com>2020-05-30 08:14:21 -0400
committerGitHub <noreply@github.com>2020-05-30 14:14:21 +0200
commit8afbb62ed5e969d78d8664df205646504f52f278 (patch)
tree3a2d9046a39eb239183832f43bd7121b5b7fd16e /tests/Hakyll/Core
parent9656e78869dd8248a8558671a48d2e52dbe7edb5 (diff)
downloadhakyll-8afbb62ed5e969d78d8664df205646504f52f278.tar.gz
Miscellaneous Windows-specific fixes and CI
Diffstat (limited to 'tests/Hakyll/Core')
-rw-r--r--tests/Hakyll/Core/Routes/Tests.hs4
-rw-r--r--tests/Hakyll/Core/Rules/Tests.hs4
-rw-r--r--tests/Hakyll/Core/UnixFilter/Tests.hs8
3 files changed, 12 insertions, 4 deletions
diff --git a/tests/Hakyll/Core/Routes/Tests.hs b/tests/Hakyll/Core/Routes/Tests.hs
index fc3d676..a3e1736 100644
--- a/tests/Hakyll/Core/Routes/Tests.hs
+++ b/tests/Hakyll/Core/Routes/Tests.hs
@@ -10,7 +10,7 @@ import Data.Maybe (fromMaybe)
import Hakyll.Core.Identifier
import Hakyll.Core.Metadata
import Hakyll.Core.Routes
-import System.FilePath ((</>))
+import System.FilePath ((</>), normalise)
import Test.Tasty (TestTree, testGroup)
import Test.Tasty.HUnit (Assertion, (@=?))
import TestSuite.Util
@@ -46,5 +46,5 @@ testRoutes expected r id' = do
store <- newTestStore
provider <- newTestProvider store
(route, _) <- runRoutes r provider id'
- Just expected @=? route
+ Just (normalise expected) @=? route
cleanTestEnv
diff --git a/tests/Hakyll/Core/Rules/Tests.hs b/tests/Hakyll/Core/Rules/Tests.hs
index 24b5b8c..80baf02 100644
--- a/tests/Hakyll/Core/Rules/Tests.hs
+++ b/tests/Hakyll/Core/Rules/Tests.hs
@@ -17,7 +17,7 @@ import Hakyll.Core.Metadata
import Hakyll.Core.Routes
import Hakyll.Core.Rules
import Hakyll.Core.Rules.Internal
-import System.FilePath ((</>))
+import System.FilePath ((</>), normalise)
import Test.Tasty (TestTree, testGroup)
import Test.Tasty.HUnit (Assertion, (@=?))
import TestSuite.Util
@@ -39,7 +39,7 @@ case01 = do
let identifiers = S.fromList $ map fst $ rulesCompilers ruleSet
routes = rulesRoutes ruleSet
checkRoute ex i =
- runRoutes routes provider i >>= \(r, _) -> Just ex @=? r
+ runRoutes routes provider i >>= \(r, _) -> Just (normalise ex) @=? r
-- Test that we have some identifiers and that the routes work out
S.fromList expected @=? identifiers
diff --git a/tests/Hakyll/Core/UnixFilter/Tests.hs b/tests/Hakyll/Core/UnixFilter/Tests.hs
index e4e0f23..314967e 100644
--- a/tests/Hakyll/Core/UnixFilter/Tests.hs
+++ b/tests/Hakyll/Core/UnixFilter/Tests.hs
@@ -1,5 +1,6 @@
--------------------------------------------------------------------------------
{-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE CPP #-}
module Hakyll.Core.UnixFilter.Tests
( tests
) where
@@ -22,10 +23,17 @@ import TestSuite.Util
--------------------------------------------------------------------------------
tests :: TestTree
tests = testGroup "Hakyll.Core.UnixFilter.Tests"
+#ifdef mingw32_HOST_OS
+ -- The `rev` utility is not present by default on Windows
+ [ testCase "unixFilter false" unixFilterFalse
+ , testCase "unixFilter error" unixFilterError
+ ]
+#else
[ testCase "unixFilter rev" unixFilterRev
, testCase "unixFilter false" unixFilterFalse
, testCase "unixFilter error" unixFilterError
]
+#endif
testMarkdown :: Identifier
testMarkdown = "russian.md"