Named unittests
Idan Arye via Digitalmars-d
digitalmars-d at puremagic.com
Tue Mar 31 14:08:11 PDT 2015
On Tuesday, 31 March 2015 at 20:04:01 UTC, 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.
Limiting unittest names to legal identifiers will save a lot of
headache when we set our tools to actually use these names.
Matching a legal identifier in a text stream is much easier than
matching an arbitrary unicode string, even if that string is
escaped.
More information about the Digitalmars-d
mailing list