[Issue 22596] The "publictests" target runs unittests at the top-level namespace so they don't have access to

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Dec 13 22:18:31 UTC 2021


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

moonlightsentinel at disroot.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #2 from moonlightsentinel at disroot.org ---
A documented unittest as defined above would contribute the following to the
documentation:

Example:
-------------------
writeln(v);
------------------

Note that the symbol `v` is entirely undefined - so the test is failing as
expected. A user should be able to execute code shown in a documented unittest
by simply adding the appropriate import.

Any unittest that relies on internal details of a module / it's members (which
are not accessible when importing said module) should be private. This also
applies to the template parameter `v`.

--


More information about the Digitalmars-d-bugs mailing list