Weired output when using newlines in error messages

Simon Hengel sol at typeful.net
Tue Jan 24 12:45:36 GMT 2012


Hi,
when I use a multi-line error message to indicate a failed test, I get
wired output on shrinking.

Here is an example:

    import Test.QuickCheck.Property

    prop_foo, prop_bar :: Int -> Result
    prop_foo n = failed {reason = "\nexpected: 23\n but got: " ++ show n}
    prop_bar n = failed {reason = "expected: 23, but got: " ++ show n}

And here is a ghci session, that illustrates the issue:

    ghci> quickCheck prop_foo
    *** Failed!
    expected: 23
    expected: 23
    expected: 23
    expected: 23
     but got: 0 (after 1 test and 2 shrinks):
    0

    ghci> quickCheck prop_bar
    *** Failed! expected: 23, but got: 0 (after 1 test and 1 shrink):
    0

`quickcheck prop_foo` produces redundant output, `quickcheck prop_bar`
works just fine.

Is this a know issue?

Cheers,
Simon

PS: What about setting up a proper issue tracker for QuickCheck (or
    maybe just use GitHub)?  I would be happy to help with this.



More information about the QuickCheck mailing list