[Haskell-beginners] How to test "error"?

Hilco Wijbenga hilco.wijbenga at gmail.com
Wed Jun 12 05:26:03 UTC 2019


Yes, "evaluate" does the trick. Thank you.

On Tue, Jun 11, 2019 at 2:39 AM Francesco Ariis <fa-ml at ariis.it> wrote:
>
> Hello Hilco,
>
> On Mon, Jun 10, 2019 at 08:44:30PM -0700, Hilco Wijbenga wrote:
> > f :: Whatever
> > f = error "This should never happen."
> >
> > spec :: Spec
> > spec =
> >     describe "f" $
> >         it "error" $
> >             return f `shouldThrow` anyErrorCall
>
>     import qualified Control.Exception as E
>
> and
>
>     E.evaluate tt' f `shouldThrow` anyErrorCall
>
> should work. Does this work?
> -F
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners


More information about the Beginners mailing list