Lookahead in unittest

H. S. Teoh via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun May 14 21:42:17 PDT 2017


On Sat, May 13, 2017 at 12:39:43PM -0400, Steven Schveighoffer via Digitalmars-d-learn wrote:
> On 5/12/17 5:46 PM, H. S. Teoh via Digitalmars-d-learn wrote:
[...]
> > This advice, unfortunately, needs to be tempered with caution about
> > namespace pollution and accidental dependency of things outside
> > unittests on things inside a version(unittest) block.  There's also
> > the issue of library code introducing extraneous import dependencies
> > that are really only necessary for unittesting, but get pulled in
> > anyway because user code happens to compile with -unittest.
> 
> This actually already happens. Any imports count, even inside
> unittests.
[...]

You're right, it does already happen. This is unfortunate, since it
means that 3rd party libraries will still get their unittests run when
users happen to compile their own code with -unittest.  Perhaps there
should be a DIP for this?


T

-- 
Bare foot: (n.) A device for locating thumb tacks on the floor.


More information about the Digitalmars-d-learn mailing list