summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLaurent P. René de Cotret <LaurentRDC@users.noreply.github.com>2020-05-27 06:16:47 -0400
committerGitHub <noreply@github.com>2020-05-27 12:16:47 +0200
commit9656e78869dd8248a8558671a48d2e52dbe7edb5 (patch)
tree499654629a923e5e68f429a6537bb702ed419037 /tests
parente97ea3afcc1779fd1a9967d8c175cdd33e0311bc (diff)
downloadhakyll-9656e78869dd8248a8558671a48d2e52dbe7edb5.tar.gz
Fix for filepath matching on Windows
Diffstat (limited to 'tests')
-rw-r--r--tests/Hakyll/Core/Identifier/Tests.hs32
1 files changed, 16 insertions, 16 deletions
diff --git a/tests/Hakyll/Core/Identifier/Tests.hs b/tests/Hakyll/Core/Identifier/Tests.hs
index 2829927..8f534a2 100644
--- a/tests/Hakyll/Core/Identifier/Tests.hs
+++ b/tests/Hakyll/Core/Identifier/Tests.hs
@@ -13,6 +13,7 @@ import Test.Tasty.HUnit ((@=?))
--------------------------------------------------------------------------------
import Hakyll.Core.Identifier
import Hakyll.Core.Identifier.Pattern
+import System.FilePath ((</>))
import TestSuite.Util
@@ -27,22 +28,21 @@ tests = testGroup "Hakyll.Core.Identifier.Tests" $ concat
--------------------------------------------------------------------------------
captureTests :: [TestTree]
captureTests = fromAssertions "capture"
- [ Just ["bar"] @=? capture "foo/**" "foo/bar"
- , Just ["foo/bar"] @=? capture "**" "foo/bar"
- , Nothing @=? capture "*" "foo/bar"
- , Just [] @=? capture "foo" "foo"
- , Just ["foo"] @=? capture "*/bar" "foo/bar"
- , Just ["foo/bar"] @=? capture "**/qux" "foo/bar/qux"
- , Just ["foo/bar", "qux"] @=? capture "**/*" "foo/bar/qux"
- , Just ["foo", "bar/qux"] @=? capture "*/**" "foo/bar/qux"
- , Just ["foo"] @=? capture "*.html" "foo.html"
- , Nothing @=? capture "*.html" "foo/bar.html"
- , Just ["foo/bar"] @=? capture "**.html" "foo/bar.html"
- , Just ["foo/bar", "wut"] @=? capture "**/qux/*" "foo/bar/qux/wut"
- , Just ["lol", "fun/large"] @=? capture "*cat/**.jpg" "lolcat/fun/large.jpg"
- , Just [] @=? capture "\\*.jpg" "*.jpg"
- , Nothing @=? capture "\\*.jpg" "foo.jpg"
- , Just ["xyz","42"] @=? capture (fromRegex "cat-([a-z]+)/foo([0-9]+).jpg") "cat-xyz/foo42.jpg"
+ [ Just ["bar"] @=? capture "foo/**" "foo/bar"
+ , Just ["foo" </> "bar"] @=? capture "**" "foo/bar"
+ , Nothing @=? capture "*" "foo/bar"
+ , Just [] @=? capture "foo" "foo"
+ , Just ["foo"] @=? capture "*/bar" "foo/bar"
+ , Just ["foo" </> "bar"] @=? capture "**/qux" "foo/bar/qux"
+ , Just ["foo" </> "bar", "qux"] @=? capture "**/*" "foo/bar/qux"
+ , Just ["foo", "bar" </> "qux"] @=? capture "*/**" "foo/bar/qux"
+ , Just ["foo"] @=? capture "*.html" "foo.html"
+ , Nothing @=? capture "*.html" "foo/bar.html"
+ , Just ["foo" </> "bar"] @=? capture "**.html" "foo/bar.html"
+ , Just ["foo" </> "bar", "wut"] @=? capture "**/qux/*" "foo/bar/qux/wut"
+ , Just ["lol", "fun" </> "large"] @=? capture "*cat/**.jpg" "lolcat/fun/large.jpg"
+ , Nothing @=? capture "\\*.jpg" "foo.jpg"
+ , Just ["xyz","42"] @=? capture (fromRegex "cat-([a-z]+)/foo([0-9]+).jpg") "cat-xyz/foo42.jpg"
]