Low level unit test library in druntime

Atila Neves via Digitalmars-d digitalmars-d at puremagic.com
Wed Aug 31 03:06:55 PDT 2016


On Tuesday, 30 August 2016 at 15:45:26 UTC, Andrei Alexandrescu 
wrote:
> On 08/30/2016 10:44 AM, Atila Neves wrote:
>> I'd much rather have `assert` be magical or have AST macros to 
>> make the
>> syntax for writing tests better than what it is now.
>
> Same here. BTW I'd like unittests that "must not compile" and 
> unittests that "must fail dynamically".
>
> For the former case, the compiler should cooperate:
>
> @incompilable unittest { ... }
> fails if it passes compilation. So the compiler must know about 
> that attribute.

Right now I think you're right and the compiler needs to know. 
But let me see what I can do about it with the language we have 
now.

> For the latter case, no change in language is necessary, only 
> in druntime:
>
> @mustfail unittest { ... }

As previously mentioned, unit-threaded has this.

Atila


More information about the Digitalmars-d mailing list