[dmd-internals] changeset 455

Andrei Alexandrescu andrei at erdani.com
Wed Apr 28 13:49:55 PDT 2010


On 04/28/2010 03:33 PM, Jason House wrote:
> On Apr 28, 2010, at 3:53 PM, Walter Bright <walter at digitalmars.com> wrote:
>
>> ----------------------------
>> int x;
>> void main() { }
>> unittest {
>> assert(x == 3, "x should be 3");
>> assert(x == 4);
>> assert(x == 5);
>> }
>> --------------------------------
>> Running it:
>>
>> test3.d(10): x should be 3
>> test3(11): unittest failure
>> test3(12): unittest failure
>
> Ick. A single assert failure in a unit test should stop that test (and
> run test teardown...). Continuing past an assert failure is useless.

That's a bug. An assertion failure stops the current unittest and 
proceeds to the next one. Walter, I meant to mention this to you when 
you first described how you plan to change unittests, but I forgot.

Andrei


More information about the dmd-internals mailing list