std.experimental.testing formal review

Meta via Digitalmars-d digitalmars-d at puremagic.com
Tue Sep 29 12:15:10 PDT 2015


On Tuesday, 29 September 2015 at 14:34:42 UTC, Atila Neves wrote:
> runTests with no optional arguments will run the tests in 
> threads.
> There's nothing about purity enforcement there. In fact, I tried
> using pure unit tests yesterday with std.experimental.testing
> and couldn't. The compiler inferred the functions to not be 
> pure.
> I tried adding pure to them and descended into a madness of 
> adding pure all over phobos until I got fed up. It seems to be 
> something to do with `format` not being pure, I have no idea 
> why. It really should be.

There are various unit tests in Phobos that are annotated with 
@pure, @nogc, nothrow, etc. to test that those attributes will be 
inferred by the compiler. In light of that, this could pose a 
problem.


More information about the Digitalmars-d mailing list