summaryrefslogtreecommitdiff
path: root/tests/Hakyll/Core
diff options
context:
space:
mode:
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"