I obviously still want to see, on failures, which property did not hold, so making one giant property with
and
is not optimal.
You could label each property using printTestCase
before making a giant property with conjoin
.
e.g. you were thinking this would be a bad idea:
prop_giant :: MyType -> Bool
prop_giant x = and [prop_one x, prop_two x, prop_three x]
this would be as efficient yet give you better output:
prop_giant :: MyType -> Property
prop_giant x = conjoin [printTestCase "one" $ prop_one x,
printTestCase "two" $ prop_two x,
printTestCase "three" $ prop_three x]
(Having said that, I've never used this method myself and am only assuming it will work; conjoin
is probably marked as experimental in the documentation for a reason.)