nick8325 / quickcheck

Automatic testing of Haskell programs.
Other
713 stars 119 forks source link

Introduce 'assertWith' for better debugging on monadic assertions #294

Closed KtorZ closed 3 years ago

KtorZ commented 4 years ago

The current 'assert' is a bit rough in the sense that it doesn't give any feedback other than something failed. In particular, if a test makes several assertions it can be tricky to figure out which one failed and for which reason. 'assertWith' makes it possible to specify an error message that is shown only on failure (piggy back on 'counterexample') but, clearly shows the result of the assertion for an easier debugging output.

Screenshot from 2020-05-04 14-40-18

Cheers :wave: