diff options
Diffstat (limited to 'tests/Hakyll')
-rw-r--r-- | tests/Hakyll/Core/UnixFilter/Tests.hs | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/tests/Hakyll/Core/UnixFilter/Tests.hs b/tests/Hakyll/Core/UnixFilter/Tests.hs index 350c857..04051e3 100644 --- a/tests/Hakyll/Core/UnixFilter/Tests.hs +++ b/tests/Hakyll/Core/UnixFilter/Tests.hs @@ -6,6 +6,7 @@ module Hakyll.Core.UnixFilter.Tests -------------------------------------------------------------------------------- +import Data.List (isInfixOf) import Test.Framework (Test, testGroup) import Test.Framework.Providers.HUnit (testCase) import qualified Test.HUnit as H @@ -13,6 +14,7 @@ import qualified Test.HUnit as H -------------------------------------------------------------------------------- import Hakyll.Core.Compiler +import Hakyll.Core.Compiler.Internal import Hakyll.Core.Item import Hakyll.Core.UnixFilter import TestSuite.Util @@ -21,7 +23,8 @@ import TestSuite.Util -------------------------------------------------------------------------------- tests :: Test tests = testGroup "Hakyll.Core.UnixFilter.Tests" - [ testCase "unixFilter rev" unixFilterRev + [ testCase "unixFilter rev" unixFilterRev + , testCase "unixFilter false" unixFilterFalse ] @@ -37,3 +40,17 @@ unixFilterRev = do where compiler = getResourceString >>= withItemBody (unixFilter "rev" []) rev = map reverse . lines + + +-------------------------------------------------------------------------------- +unixFilterFalse :: H.Assertion +unixFilterFalse = do + store <- newTestStore + provider <- newTestProvider store + result <- testCompiler store provider "russian.md" compiler + H.assert $ case result of + CompilerError e -> "exit code" `isInfixOf` e + _ -> False + cleanTestEnv + where + compiler = getResourceString >>= withItemBody (unixFilter "false" []) |