mirror of
https://github.com/simonmichael/hledger.git
synced 2024-12-26 03:42:25 +03:00
assertParse now generates test failures
This commit is contained in:
parent
b2c8933af4
commit
f937f59276
@ -292,7 +292,7 @@ a `is` e = assertEqual "" e a
|
||||
|
||||
-- | Assert a parse result is some expected value, or print a parse error.
|
||||
assertParse :: (Show a, Eq a) => (Either ParseError a) -> a -> Assertion
|
||||
assertParse parse expected = either printParseError (`is` expected) parse
|
||||
assertParse parse expected = either (assertFailure.show) (`is` expected) parse
|
||||
|
||||
printParseError :: (Show a) => a -> IO ()
|
||||
printParseError e = do putStr "parse error at "; print e
|
||||
|
Loading…
Reference in New Issue
Block a user