Named unittests

Dicebot via Digitalmars-d digitalmars-d at puremagic.com
Tue Mar 31 06:34:23 PDT 2015


On Tuesday, 31 March 2015 at 10:25:57 UTC, Idan Arye wrote:
> I understand the preference to librarize as much as possible, 
> but I don't think the desire to sacrifice every possible bit of 
> convenience to avoid the tiniest changes to the language is 
> always beneficial. I don't say that implementing everything 
> inside the compiler is good either though, but in many cases 
> some slight changes to the language can make the library 
> solution so much more simple and elegant.
>
> In this case, allowing to name a unittest should be a very 
> simple language change that'll make any library implementation 
> of the rest of the feature more elegant to use, simpler to 
> implement, and more consistent with alternative library 
> implementations.

It isn't simple at all. Name is just one of many meta-values you 
commonly want to attach to unittest block. Some others: 
description, dependency, parallelization, benchmark tag, I/O 
indicator. It is simply impossible to foresee it all in a 
language feature - but it is exactly kind of data UDA are 
designed for. All we need is to enhance/fix the language to 
actually make using of that information convenient.


More information about the Digitalmars-d mailing list