Postmortem: Template unittests are bad & you shouldn't catch Error

H. S. Teoh hsteoh at quickfur.ath.cx
Thu Oct 22 21:03:34 UTC 2020


On Thu, Oct 22, 2020 at 03:18:03PM -0400, Steven Schveighoffer via Digitalmars-d wrote:
[...]
> Another thing I've advocated for strongly is to not run imported
> unittests ever, even in templates.
[...]

+1.  This has necessitated the silly StdUnittest hack in Phobos, and
AFAIK no other D library has used a similar hack, which means that every
single time somebody imports an 3rd party library and compiles with
-unittest, the library's unittests get run all over again for the
millionth time.  It's useless weight and redundant work, and should be
eliminated.


T

-- 
Democracy: The triumph of popularity over principle. -- C.Bond


More information about the Digitalmars-d mailing list