nick8325 / quickcheck

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

Introduced assertException and assertDeepException #222

Closed lehins closed 5 months ago

lehins commented 5 years ago

I found myself needing these functions on multiple occasions and thought that others might benefit from them as well. Please, let me know if there is anything you'd like me to change in order to get this PR merged.

Use case for those functions is pretty straightforward:

λ> quickCheck $ \ x -> assertException (==DivideByZero) (x `div` 0)
+++ OK, passed 100 tests.

I thought at first Test.QuickCheck.Exception would be a good home for these functions, but it'll be too hard to avoid import cycles.

MaximilianAlgehed commented 6 months ago

This is related to #265

MaximilianAlgehed commented 6 months ago

Closes #265 and #230 as it would provide the necessary functionality for both of these.

MaximilianAlgehed commented 5 months ago

@lehins do you have the time to bring this up to date so we can merge it? If not just let me know and I can do it.

Thank you for the addition!

lehins commented 5 months ago

@MaximilianAlgehed Thank you for an overdue PR review and thank you for giving the much needed attention to QuickCheck.

I've improved the haddock a bit and addressed your comments.