On Thursday, 10 March 2016 at 08:09:40 UTC, Jacob Carlborg wrote: > On 2016-03-09 19:01, Atila Neves wrote: >> The forum must be sick of hearing from me... :P For those not in the >> know, unit-threaded is an advanced unit testing library for D: >> >> http:// code.dl ang.org/ packages/ unit-threaded >> >> The v0.6.3 release had tests parametrized by value; this v0.6.5 release >> brings with it the possibility of parametrizing tests by type, like so: >> >> @Types!(int, byte) >> void testInit(T)() { >> assert(T.init == 0); >> } >> >> This will run the testInit code twice, once for each type, and report >> them as separate tests: >> >> tests.pass. attributes. testInit.int: >> tests.pass. attributes. testInit.byte: >> >> >> I've literally only written that silly testInit example yet. But imagine >> how easy it'd be to test, say, different input ranges. >> >> I'm thinking of ways of getting the parametrized tests to work with the >> built-in unittest blocks. I assume it'll be hacky. Right now it's the >> only thing that requires non-standard test functions and I'm trying to >> augment the existing unit testing features of D instead of replacing them. The forum must be sick of hearing from me... :P For those not in theknow, unit-threaded is an advanced unit testing library for D:The v0.6.3 release had tests parametrized by value; this v0.6.5 releasebrings with it the possibility of parametrizing tests by type, like so:@Types!(int, byte)void testInit(T)() {assert(T.init == 0);This will run the testInit code twice, once for each type, and reportthem as separate tests:I've literally only written that silly testInit example yet. But imaginehow easy it'd be to test, say, different input ranges.I'm thinking of ways of getting the parametrized tests to work with thebuilt-in unittest blocks. I assume it'll be hacky. Right now it's theonly thing that requires non-standard test functions and I'm trying toaugment the existing unit testing features of D instead of replacing them. > > Do you have a slightly more extended example that shows how this is used? On 2016-03-09 19:01, Atila Neves wrote:Do you have a slightly more extended example that shows how this is used?