Consider the following QuickCheck program in Haskell
{-# LANGUAGE TemplateHaskell #-}
import Test.QuickCheck
import Test.QuickCheck.All
prop_trivial :: Bool
prop_trivial = 42 == (6 * 7)
-- Wacky boilerplate to make all tests run.
return []
runTests = $quickCheckAll
main = do
runTests
This works with ghc version 7.8.3 and QuickCheck 2.7.6. Problem is that it repeats the test 100 times. I look around for a mitigation and find exhaustive
in the QuickCheck docs here. Groovy! I change my prop_trivial
to the following:
prop_trivial = exhaustive $ property $ 42 == (6 * 7)
which type-checks and compiles, but fails:
=== prop_trivial from /blahblahblah/FooTest.hs:6 ===
*** Failed! Falsifiable (after 1 test):
False
I'm a bit stuck on how to understand and debug this result; the docs are a bit too thin for me to figure out what's going on.