[QuickCheck] Bug: Show broken for Fun values

Nick Smallbone nicsma at chalmers.se
Sun Oct 21 13:39:38 BST 2012


Hi Jannis,

I've just pushed a patch that fixes this! I accidentally broke it in
the first place while trying to fix another bug.

Nick

On 9 October 2012 23:30, Jannis Harder <jix at jixco.de> wrote:
> The changes to shrinking of Fun values introduced in commit 7ceb866d
> "An attempt at allowing partial showable functions" result in a discard
> exception being thrown during show sometimes.
>
> This can be reproduced in ghci as follows:
>> :m + Test.QuickCheck Test.QuickCheck.Function
>> quickCheck (const False :: Fun Int (Fun Int Int) -> Bool)
> *** Failed!  (after 1 test and 2 shrinks):
> {Exception thrown by generator: 'DISCARD. You should not see this exception, it is internal to QuickCheck.'
>
> This example is pretty silly, but I ran across this bug while writing a
> larger real test I was working on.
>
> As a workaround I just changed the use of whenever back to list
> comprehension guards, but I guess the change had some intended effect in
> the first place.
>
> Regards,
> Jannis
>
> _______________________________________________
> QuickCheck mailing list
> QuickCheck at projects.haskell.org
> http://projects.haskell.org/cgi-bin/mailman/listinfo/quickcheck



More information about the QuickCheck mailing list