Named unittests

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Mon Mar 30 15:02:13 PDT 2015


On 3/30/15 2:59 PM, Panke wrote:
>>
>> I've implemented this in a library and I'm sure others have as well.
>> Are you sure, you want a language solution?
>
> Basic principle:
>
> ---
> unittest {
>
>      testCase("a testcase",
>      {
>          // actual test code here
>      });
> }
> ---

Looks a bit too much work.

> Testcase registers the structure and the runtime just runs the unittest
> as is does today and than calls all closures registered during the
> unittest. Makes this fully backward compatible.

Backward compatibility is not an issue seeing this is a pure addition.


Andrei


More information about the Digitalmars-d mailing list