summaryrefslogtreecommitdiff
path: root/tests/Hakyll/Core/Identifier/Tests.hs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Hakyll/Core/Identifier/Tests.hs')
-rw-r--r--tests/Hakyll/Core/Identifier/Tests.hs22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/Hakyll/Core/Identifier/Tests.hs b/tests/Hakyll/Core/Identifier/Tests.hs
new file mode 100644
index 0000000..43dd6c1
--- /dev/null
+++ b/tests/Hakyll/Core/Identifier/Tests.hs
@@ -0,0 +1,22 @@
+{-# LANGUAGE OverloadedStrings #-}
+module Hakyll.Core.Identifier.Tests
+ ( tests
+ ) where
+
+import Test.Framework
+import Test.HUnit hiding (Test)
+
+import Hakyll.Core.Identifier.Pattern
+import TestSuite.Util
+
+tests :: [Test]
+tests = fromAssertions "match"
+ [ Just ["bar"] @=? match "foo/**" "foo/bar"
+ , Just ["foo/bar"] @=? match "**" "foo/bar"
+ , Nothing @=? match "*" "foo/bar"
+ , Just [] @=? match "foo" "foo"
+ , Just ["foo"] @=? match "*/bar" "foo/bar"
+ , Just ["foo/bar"] @=? match "**/qux" "foo/bar/qux"
+ , Just ["foo/bar", "qux"] @=? match "**/*" "foo/bar/qux"
+ , Just ["foo", "bar/qux"] @=? match "*/**" "foo/bar/qux"
+ ]