Skip to content

Commit

Permalink
Merge pull request #42 from alephcloud/master
Browse files Browse the repository at this point in the history
Fix quick check test suite to actually fail if there is a failure
  • Loading branch information
ekmett committed Jul 14, 2014
2 parents 76f9bbe + 205538a commit 4483834
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tests/QuickCheck.hs
Expand Up @@ -24,6 +24,8 @@ import Text.Parser.Char
import Text.Parser.Combinators
import Text.ParserCombinators.ReadP (readP_to_S)

import System.Exit

-- -------------------------------------------------------------------------- --
-- Run tests with different parser frameworks

Expand All @@ -50,7 +52,12 @@ instance Arbitrary (TestParser a) where
-- Main

main :: IO ()
main = mapM_ quickCheck tests
main = mapM quickCheckResult tests >>= \x -> case filter (not . passed) x of
[] -> exitSuccess
_ -> exitFailure
where
passed Success{} = True
passed _ = False

-- -------------------------------------------------------------------------- --
-- Tests
Expand Down

0 comments on commit 4483834

Please sign in to comment.