
27 Nov
2012
27 Nov
'12
7:22 a.m.
How can you be sure that you get a certain error? Depending on the order of evaluation you might get different error messages if there are multiple possible ways to fail. I think automated testing against specific error messages will not work reliably.
If the function/value under specification is so "insane" that it contains a /set of exceptions/, then you have to be prepared to get any of those [1]: evaluate value `shouldThrow` (||) <$> (== ErrorCall "foo") <*> (== ErrorCall "bar") Again, I'm not implying that it's a good idea to write a function that behave like that. But if you do, I'd at least like to have it documented ;) Cheers, Simon [1] http://research.microsoft.com/en-us/um/people/simonpj/papers/imprecise-exn.h...