diff options
author | Jasper Van der Jeugt <m@jaspervdj.be> | 2012-02-19 20:29:26 +0100 |
---|---|---|
committer | Jasper Van der Jeugt <m@jaspervdj.be> | 2012-02-19 20:39:23 +0100 |
commit | 1996052b110b8528e90d76c06e13c0b7e4a2e93a (patch) | |
tree | 306aa351fb307feecfc504b9593e6507e38353fb /tests/Hakyll/Core/Identifier | |
parent | 2416c76faa0dadb330c74dc0f3ddefdf4f889659 (diff) | |
download | hakyll-1996052b110b8528e90d76c06e13c0b7e4a2e93a.tar.gz |
Add complement function for patterns
Diffstat (limited to 'tests/Hakyll/Core/Identifier')
-rw-r--r-- | tests/Hakyll/Core/Identifier/Tests.hs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/Hakyll/Core/Identifier/Tests.hs b/tests/Hakyll/Core/Identifier/Tests.hs index 4060b1f..c496a98 100644 --- a/tests/Hakyll/Core/Identifier/Tests.hs +++ b/tests/Hakyll/Core/Identifier/Tests.hs @@ -37,8 +37,10 @@ captureTests = fromAssertions "capture" 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" + [ True @=? matches (list ["foo.markdown"]) "foo.markdown" , False @=? matches (list ["foo"]) (Identifier (Just "foo") "foo") + , True @=? matches (regex "^foo/[^x]*$") "foo/bar" + , False @=? matches (regex "^foo/[^x]*$") "foo/barx" + , True @=? matches (complement "foo.markdown") "bar.markdown" + , False @=? matches (complement "foo.markdown") "foo.markdown" ] |