
15 Apr
2011
15 Apr
'11
9:36 a.m.
Occasionally I write a QuickCheck test where I want to evaluate something just to make sure it doesn't crash, but I don't care about the actual value. For example, in the test below, I just want to make sure that the expression "foldl' apply newWorkbench gs" doesn't crash. I don't really care whether or not "devotion w /= -1", that's just an expression (which is always true) that I wrote to force evaluation of w. But I assume there's a better way to do this? prop_all_gene_sequences_are_legal :: [Gene] -> Property prop_all_gene_sequences_are_legal gs = property $ devotion w /= -1 where w = foldl' apply newWorkbench gs Thank you in advance for any suggestions.