[QuickCheck] Unxpected compositional behaviour
Erik de Castro Lopo
mle+hs at mega-nerd.com
Wed Jan 29 06:28:07 GMT 2014
Hi all,
This issue came up with respect to Hspec which uses QuickCheck as a
library:
https://github.com/hspec/hspec/issues/149
but it seems to really be a QuickCheck issue which can be easily
demonstrated like this:
ghci> import Test.QuickCheck
ghci> let prop_foo = 1 == 2
ghci> let prop_bar = 1 == 1
ghci> quickCheck (property prop_foo >> property prop_bar)
+++ OK, passed 100 tests.
The first of those properties should fail, but doesn't. I think, that
without knowing the current behaviour, most people asked to guess what
the behaviour *should* be would say that the first property should
cause the failure of the whole test.
Do other people have the same view? Can this be easily fixed?
Cheers,
Erik
--
----------------------------------------------------------------------
Erik de Castro Lopo
http://www.mega-nerd.com/
More information about the QuickCheck
mailing list