diff options
author | Jasper Van der Jeugt <jaspervdj@gmail.com> | 2011-05-29 12:17:36 +0200 |
---|---|---|
committer | Jasper Van der Jeugt <jaspervdj@gmail.com> | 2011-05-29 12:17:36 +0200 |
commit | 25b28d8ba4792bf31e2add88607f868f7b88bdd8 (patch) | |
tree | 7289fab01437a6f82e07dde1d9e6e23db2d84177 /tests/Hakyll/Core | |
parent | d3f15b18a537aac6364c27c6e726bcd11c869888 (diff) | |
download | hakyll-25b28d8ba4792bf31e2add88607f868f7b88bdd8.tar.gz |
Some list matches in the tests
Diffstat (limited to 'tests/Hakyll/Core')
-rw-r--r-- | tests/Hakyll/Core/Identifier/Tests.hs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/Hakyll/Core/Identifier/Tests.hs b/tests/Hakyll/Core/Identifier/Tests.hs index 6eb992a..4060b1f 100644 --- a/tests/Hakyll/Core/Identifier/Tests.hs +++ b/tests/Hakyll/Core/Identifier/Tests.hs @@ -6,13 +6,14 @@ module Hakyll.Core.Identifier.Tests import Test.Framework import Test.HUnit hiding (Test) +import Hakyll.Core.Identifier import Hakyll.Core.Identifier.Pattern import TestSuite.Util tests :: [Test] tests = concat [ captureTests - , regexTests + , matchesTests ] captureTests :: [Test] @@ -34,8 +35,10 @@ captureTests = fromAssertions "capture" , Nothing @=? capture "\\*.jpg" "foo.jpg" ] -regexTests :: [Test] -regexTests = fromAssertions "regex" +matchesTests :: [Test] +matchesTests = fromAssertions "matches" [ True @=? matches (regex "^foo/[^x]*$") "foo/bar" , False @=? matches (regex "^foo/[^x]*$") "foo/barx" + , True @=? matches (list ["foo.markdown"]) "foo.markdown" + , False @=? matches (list ["foo"]) (Identifier (Just "foo") "foo") ] |