
12 Jan
2011
12 Jan
'11
8:05 a.m.
Serge Le Huitouze
So, do you have any "methodology" for such use cases?
QuickCheck has the ==> operator, which lets you add a precondition. So you could limit the testing of your property to values that satisfy the precondition. An alternative is to use newtype with a custom generator to produce only data that makes sense. Of course, ideally you should design your types so that all possible values are meaningful :-) -k -- If I haven't seen further, it is by standing in the footprints of giants