Low level unit test library in druntime

Marc Schütz via Digitalmars-d digitalmars-d at puremagic.com
Wed Aug 31 04:53:23 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.
>

There should be a way to specify the error message (or match it 
against a regex); otherwise the test could fail accidentally for 
totally unrelated reasons, and nobody would notice...


More information about the Digitalmars-d mailing list