[Issue 13291] unittest should be allowed inside template functions

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Dec 18 06:17:30 PST 2014


https://issues.dlang.org/show_bug.cgi?id=13291

--- Comment #10 from Steven Schveighoffer <schveiguy at yahoo.com> ---
(In reply to Andrei Alexandrescu from comment #9)
> I just realized this can be realized with relative ease as follows:
> 
> void fun(T)(T arg)
> {
>    version(unittest)
>    {
>       ... testing ...
>    }
>    ... stuff ...
> }

That won't run during unit tests, though. But I think Timon's point covers the
request.

--


More information about the Digitalmars-d-bugs mailing list