https://issues.dlang.org/show_bug.cgi?id=13291
Steven Schveighoffer <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #7 from Steven Schveighoffer <[email protected]> --- Using the template instantiation to cover all unit tests is both a boon and a curse. I use it in dcollections to great effect, and have found several D/phobos bugs just with that use. However, often you do NOT want to instantiate unit tests for ALL invocations. Consider this: T max(T)(T x, T y) A test for max might look like: unittest { T t1 = 0, t2 = 1, t3 = 2; assert(max(t1, t2) == t2); assert(max(t2, t1) == 1); assert(max(t1, t3) == t3); assert(max(t3, t2) == 2); // etc... } But what if T is string? Now, you have to create a different unit test because the literals are different. Unit tests require both input and results, and the input isn't always easy to determine for any generic type. --
