Question about unittests

Ary Manzana ary at esperanto.org.ar
Wed Jan 10 06:01:22 PST 2007


mfeathers escribió:
> 
> Thanks.  Another quick question.  Is "assert" legal syntax outside of 
> contacts and unit tests?  For instance, can I do this:
> 
> unittest {
>     someMethod();
> }
> 
> void someMethod() {
>     assert 0 == 1
> }

Yes. Asserts are always evaluated if you provided -debug to the 
compiler. Of course for asserts in unittests to work you also have to 
provider -unittest to the compiler.


More information about the Digitalmars-d-learn mailing list