[Haskell-beginners] wierd quickcheck outcome
Roelof Wobben
r.wobben at home.nl
Thu Sep 10 07:23:29 UTC 2015
Hello,
I have this function :
fourDifferent:: Integer -> Integer -> Integer -> Integer -> Bool
fourDifferent a b c d = ( a == b ) && ( a == c ) && (a == d)
which I wants to test with this function :
prop_fourDifferent :: Integer -> Integer -> Integer -> Integer -> Bool
prop_fourDifferent a b c d = fourDifferent a b c d == ( a == b ) && ( a
== c ) && (a == d)
so I do quickCheck propFourDifferent and see this outcome :
*Solution> quickCheck prop_fourDifferent
*** Failed! Falsifiable (after 2 tests and 2 shrinks):
0
0
0
1
*Solution> fourDifferent 0 0 0 1
False
*Solution> let a = 0
*Solution> let b = 0
*Solution> let c = 0
*Solution> let d = 1
*Solution> (a == b) && ( a == c) && ( a == d ) False
*Solution>
So why is it failing. both gives false ,
Roelof
More information about the Beginners
mailing list