Question about unittests

BCS ao at pathlink.com
Wed Jan 10 21:40:12 PST 2007


Reply to Ary,

> 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.
> 

asserts are active unless you give the -release flag, even without the -debug 
flag




More information about the Digitalmars-d-learn mailing list