Module provides convenient functions to do some assertions in QuickCheck
properties with pretty printed reasons. For example you can do something like
that:
module Main whereimport Test.Hspecimport Test.Hspec.QuickCheckimport Test.QuickCheck.Assertionsimport Test.QuickCheck.PropertysomeProp :: Int -> Int -> ResultsomeProp a b = (a ?> b)
someOtherProp :: Double -> Double -> ResultsomeOtherProp a b = (a ?== b)
main = hspec $ describe "failing test" $ do
prop "must fail" $ someProp
prop "must fail again" $ someOtherProp
And receive pretty printed fail message when testing:
failing test
- must fail FAILED [1]
- must fail again FAILED [2]
1) failing test must fail FAILED
*** Failed! (after 1 test):
>>>>>>>>>>>>>> the value
0
>>>>>>>>>>>>>> should be greater than value
0002) failing test must fail again FAILED
*** Failed! (after 2 tests and 4 shrinks):
>>>>>>>>>>>>>> expected
0.0
>>>>>>>>>>>>>> but got
1.00.01.0
Changes
0.3.0
Changelog added
Use pretty-show for error descriptions (usefull with huge test
cases)