Unittests and assert

Andrej Mitrovic andrej.mitrovich at gmail.com
Wed Feb 27 20:58:47 PST 2013


On Thursday, 28 February 2013 at 04:52:01 UTC, H. S. Teoh wrote:
> Why? Because when you compile with -release -unittest, all 
> those asserts
> disappear, and the unittests become useless.

Are you sure? The asserts work for me:

unittest
{
     int getZero() { return 0; }
     assert(getZero != 0);
}

void main() { }

$ dmd -release -unittest test.d
$ test.exe
> core.exception.AssertError at test(6): unittest failure


More information about the Digitalmars-d mailing list