on master help sign in
Some list matches in the tests
25b28d8Jasper Van der Jeugt
tests/Hakyll/Core/Identifier/Tests.hs+6−3
@@ -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)
8
8
9+import Hakyll.Core.Identifier
9import Hakyll.Core.Identifier.Pattern
10import Hakyll.Core.Identifier.Pattern
10import TestSuite.Util
11import TestSuite.Util
11
12
12tests :: [Test]
13tests :: [Test]
13tests = concat
14tests = concat
14 [ captureTests
15 [ captureTests
15− , regexTests
16+ , matchesTests
16 ]
17 ]
17
18
18captureTests :: [Test]
19captureTests :: [Test]
@@ -34,8 +35,10 @@ captureTests = fromAssertions "capture"
34 , Nothing @=? capture "\\*.jpg" "foo.jpg"
35 , Nothing @=? capture "\\*.jpg" "foo.jpg"
35 ]
36 ]
36
37
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")
41 ]
44 ]