Named unittests

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Tue Mar 31 13:18:41 PDT 2015


On 3/31/15 1:04 PM, Jacob Carlborg wrote:
> On 2015-03-31 16:55, Meta wrote:
>
>> Aren't unittest blocks just special functions? If that's the case, there
>> should be no problem being able to give them names. It seems to me that
>> it would entail the lifting of a restriction rather than a real language
>> change.
>>
>> Before:
>> unittest
>> {
>>      assert(1 == 1);
>> }
>>
>> After:
>> unittest checkBasicLaw
>> {
>>      assert(1 == 1);
>> }
>
> I prefer a UDA accepting a string, this can contain spaces and it's not
> limited to identifier names.

I used to think the same, but then I figured a bit of structure might be 
preferable. -- Andrei



More information about the Digitalmars-d mailing list