Okay, as I learned via my previous question, the RWH book is already out of date for QuickCheck. And despite all the posts I've read that tell me how incredibly simple it is to use QuickCheck, I cannot find any place that tells me how to change the number of tests to run for a property.
RWH says:
handyCheck limit = check defaultConfig {
configMaxTest = limit
, configEvery = \_ _ -> ""
}
How to do this with QuickCheck 2.4? More importantly, how would I have found out myself? Please don't tell me that I should've been able to figure it out from the API documentation.
For those who want to run all tests at once and provide their configuration:
You are looking for:
How I found out
quickCheck
was theArgs
type with amaxSuccess
field.Args
- findingstdArgs
. (Use your browsers search function - ctrl-f usually). OTOH, I could have used hoogle.Args
type somewhere so I kept looking. The next line wasquickCheckWith
- bingo! On the other hand, I could have used hoogle.How Else Can You Find Out
As I stated above, you could have used hoogle to find a lot of the functions, assuming you realize the
Args
type is the core of what you need (from the haddocks).Otherwise, you are probably reduced to looking at what other packages do, which means you need to know what other packages are worth looking at. The examples folder in QuickCheck seems obvious, but not all packages include such examples. Using reverse dependencies you can often find a package to look at, but for QC lots of packages don't have explicit dependencies.