Show failing value in case of an exception
It would be cool if, even when an exception occurs during a tested property, the failing value could be shown. E.g. consider the following EasyCheck property from the json
module:
-- Test property of pretty printing and parsing.
testParsePrint :: JValue -> Prop
testParsePrint json =
always (eqJValue (fromJust (parseJSON (ppJSON json))) json)
If parsing fails, we only get the following error:
testParsePrint (module SimpleTest, line 33): EXECUTION FAILURE:
user error: Maybe.fromJust: Nothing
==============================================================================
FAILURES OCCURRED IN SOME TESTS:
testParsePrint (module SimpleTest, line 33)
==============================================================================
Evaluation terminated with non-zero status 1
Here, it would be nice if the JValue
that caused the test to fail could be printed.