How do you test pre-/post-conditions and invariants?

spir denis.spir at gmail.com
Sat Feb 26 04:45:50 PST 2011


On 02/26/2011 12:24 PM, Magnus Lie Hetland wrote:
> However, I could always add a call to my unit test, run it, and see it crash --
> and then comment it out. Doesn't seem like the prettiest way to handle things,
> but it's OK, I guess together with the idea of making the contracts
> super-simple (and to test any functionality they use separately).

With named unittests, you could also have one of them check failure cases, and 
just comment out its call.

Denis
-- 
_________________
vita es estrany
spir.wikidot.com



More information about the Digitalmars-d-learn mailing list