diff options
author | Jasper Van der Jeugt <m@jaspervdj.be> | 2012-11-20 11:36:45 +0100 |
---|---|---|
committer | Jasper Van der Jeugt <m@jaspervdj.be> | 2012-11-20 11:36:45 +0100 |
commit | bfa10560f87b1843f9302a70f6c9333fc2731e88 (patch) | |
tree | ebba1270dad7f601c5188c455e3d642130f0ac83 /tests/Hakyll/Core/Identifier | |
parent | b1f70c339e031c1f6abf04ff63566f2cb9757a07 (diff) | |
download | hakyll-bfa10560f87b1843f9302a70f6c9333fc2731e88.tar.gz |
Re-enable some tests
Diffstat (limited to 'tests/Hakyll/Core/Identifier')
-rw-r--r-- | tests/Hakyll/Core/Identifier/Tests.hs | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/tests/Hakyll/Core/Identifier/Tests.hs b/tests/Hakyll/Core/Identifier/Tests.hs index c496a98..b477a7c 100644 --- a/tests/Hakyll/Core/Identifier/Tests.hs +++ b/tests/Hakyll/Core/Identifier/Tests.hs @@ -1,21 +1,30 @@ +-------------------------------------------------------------------------------- {-# LANGUAGE OverloadedStrings #-} module Hakyll.Core.Identifier.Tests ( tests ) where -import Test.Framework -import Test.HUnit hiding (Test) -import Hakyll.Core.Identifier -import Hakyll.Core.Identifier.Pattern -import TestSuite.Util +-------------------------------------------------------------------------------- +import Test.Framework (Test, testGroup) +import Test.HUnit ((@=?)) -tests :: [Test] -tests = concat + +-------------------------------------------------------------------------------- +import Hakyll.Core.Identifier +import Hakyll.Core.Identifier.Pattern +import TestSuite.Util + + +-------------------------------------------------------------------------------- +tests :: Test +tests = testGroup "Hakyll.Core.Identifier.Tests" $ concat [ captureTests , matchesTests ] + +-------------------------------------------------------------------------------- captureTests :: [Test] captureTests = fromAssertions "capture" [ Just ["bar"] @=? capture "foo/**" "foo/bar" @@ -35,12 +44,15 @@ captureTests = fromAssertions "capture" , Nothing @=? capture "\\*.jpg" "foo.jpg" ] + +-------------------------------------------------------------------------------- matchesTests :: [Test] matchesTests = fromAssertions "matches" - [ 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 (fromList ["foo.markdown"]) "foo.markdown" + , False @=? matches (fromList ["foo"]) (setVersion (Just "x") "foo") + , True @=? matches (fromVersion (Just "xz")) (setVersion (Just "xz") "bar") + , True @=? matches (fromRegex "^foo/[^x]*$") "foo/bar" + , False @=? matches (fromRegex "^foo/[^x]*$") "foo/barx" , True @=? matches (complement "foo.markdown") "bar.markdown" , False @=? matches (complement "foo.markdown") "foo.markdown" ] |