verboseCheck in QuickCheck 2?
Asked Answered
C

5

10

The function verboseCheck from QuickCheck 1 seems to be absent in QuickCheck 2 (or at least, I can't find it). Is there any other way to show which values are used during testing?

Cleocleobulus answered 25/3, 2010 at 16:2 Comment(0)
B
2

Looks like verbose (and other verbose- functions) were returned back to QuickCheck in version 2.4

Batfish answered 8/6, 2011 at 17:48 Comment(0)
E
7

The sample function is also useful:

Prelude Test.QuickCheck
ghci> sample (arbitrary :: Gen String)
""
")\223"
"(\227\&5F"
"\DC1"
"\136'\140\180\FS"
"K\DC2\NUL\CAN\253Q"
"\DC4\f\184&.\DC3\159\&1I\160j\147"
....

This way, it's easy to play with your Arbitrary instances, and make sure they generate what you think they generate.

Epilepsy answered 26/3, 2010 at 22:2 Comment(0)
Y
4

Yes, this seems to be a functionality regression with respect to QuickCheck 1.

You can work around it by annotating your properties with a Debug.Trace.trace statement, however. Something like:

import Debug.Trace

prop_eq xs = traceShow xs $ 
   xs == reverse (reverse xs)
Yhvh answered 25/3, 2010 at 18:1 Comment(0)
C
3

I've been happy with

import Debug.Trace
verboseCheck prop = quickCheck (\input -> traceShow input $ prop input)
Croupier answered 21/10, 2010 at 19:50 Comment(0)
B
2

Looks like verbose (and other verbose- functions) were returned back to QuickCheck in version 2.4

Batfish answered 8/6, 2011 at 17:48 Comment(0)
O
1

I took a look at sources, and it seems that Args were refactored, configEvery is no longer there, and thus you are not able to print all test values without patching QuichCheck sources

Ochlocracy answered 25/3, 2010 at 16:57 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.