@@ -6,13 +6,14 @@ module Hakyll.Core.Identifier.Tests
6import Test.Framework
6import Test.Framework
7import Test.HUnit hiding (Test)
7import Test.HUnit hiding (Test)
9+import Hakyll.Core.Identifier
9import Hakyll.Core.Identifier.Pattern
10import Hakyll.Core.Identifier.Pattern
10import TestSuite.Util
11import TestSuite.Util
12tests :: [Test]
13tests :: [Test]
13tests = concat
14tests = concat
14 [ captureTests
15 [ captureTests
15− , regexTests
16+ , matchesTests
18captureTests :: [Test]
19captureTests :: [Test]
@@ -34,8 +35,10 @@ captureTests = fromAssertions "capture"
34 , Nothing @=? capture "\\*.jpg" "foo.jpg"
35 , Nothing @=? capture "\\*.jpg" "foo.jpg"
37−regexTests :: [Test]
38+matchesTests :: [Test]
38−regexTests = fromAssertions "regex"
39+matchesTests = fromAssertions "matches"
39 [ True @=? matches (regex "^foo/[^x]*$") "foo/bar"
40 [ True @=? matches (regex "^foo/[^x]*$") "foo/bar"
40 , False @=? matches (regex "^foo/[^x]*$") "foo/barx"
41 , False @=? matches (regex "^foo/[^x]*$") "foo/barx"
42+ , True @=? matches (list ["foo.markdown"]) "foo.markdown"
43+ , False @=? matches (list ["foo"]) (Identifier (Just "foo") "foo")