Bug 20528 – Stray unit test in phobos is run by user code compiled with -unittest

Status
RESOLVED
Resolution
INVALID
Severity
minor
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2020-01-23T13:52:33Z
Last change time
2020-01-23T14:27:55Z
Assigned to
No Owner
Creator
Steven Schveighoffer

Comments

Comment #0 by schveiguy — 2020-01-23T13:52:33Z
Using writefln causes a unittest to be pulled in from Phobos into user code. example: ------- import std.stdio; void main() { writefln("hello"); } -------- dmd -run -unittest app.d 1 unittests passed Phobos should not be inserting unittests into user's code. See related issue 20500
Comment #1 by schveiguy — 2020-01-23T14:27:55Z
Oops, Rainer already fixed this: https://github.com/dlang/phobos/pull/7359