unit-threaded v0.8.0

jmh530 john.michael.hall at gmail.com
Wed Jan 30 14:55:37 UTC 2019


On Wednesday, 30 January 2019 at 14:27:25 UTC, Atila Neves wrote:
> [snip]
>
> ------------------
> @Types!(ubyte, byte)
> @Types!(int, uint, float)
> @UnitTest
> void fun(T0, T1)() {
>     static assert(T0.sizeof == 1);
>     static assert(T1.sizeof == 4);
> }
> ------------------
>
> This now generates 6 tests, one for each combination of types, 
> similarly to what already worked with the @Values UDA.

I'm a little confused on this. What if you have void fun(T0, T1, 
T2)) {}, but only two @Types listed? Does it just do the first 
two?

Also, there is an example in the readme on @Values of
@Values(1, 2, 3) unittest { assert(getValue!int % 2 == 0); }
What if it's not so easy to create the values? I suppose you 
could pass the parameters in @Values to some other function that 
will then create what you actually need and then test using that. 
Maybe good to provide some more examples of advanced usage?


More information about the Digitalmars-d-announce mailing list