www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 20528] New: Stray unit test in phobos is run by user code

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

          Issue ID: 20528
           Summary: Stray unit test in phobos is run by user code compiled
                    with -unittest
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: minor
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: schveiguy yahoo.com

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

--
Jan 23