[Haskell-cafe] Using quickcheck to check for errors

Rafael Almeida almeidaraf at gmail.com
Sat Jun 7 18:56:42 UTC 2014


Let's say we want to quickcheck the function !!. Passing a negative index
to it is an error. However, how can you make a check that it indeed errors
in such situation?

prop_negative_index_generates_error list = forAll negativeIndex \x -> ...

What should I write in ...?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20140607/6a55ecf3/attachment.html>

More information about the Haskell-Cafe mailing list