You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Arbitrary instances for exceptions are trivial but tedious to define. Someone has already done the work in text-show package tests, why do we not publish this so that it is reusable?
It would be useful when checking code that manages exception handling. IO code may be mocked in Catch monad and tested for exception resilience. I am actually doing this somewhere even now.
The text was updated successfully, but these errors were encountered:
Actually the code at the link is not fit for use cases where arbitrary :: Gen SomeException should generate all kinds of exceptions. At that link, it is defined thusly:
instance Arbitrary SomeException where
arbitrary = SomeException <$> (arbitrary :: Gen AssertionFailed)
— So it will only ever generate failed assertions. The more reason to create a more "varied" generator!
Arbitrary instances for exceptions are trivial but tedious to define. Someone has already done the work in
text-show
package tests, why do we not publish this so that it is reusable?It would be useful when checking code that manages exception handling. IO code may be mocked in
Catch
monad and tested for exception resilience. I am actually doing this somewhere even now.The text was updated successfully, but these errors were encountered: