[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
Tue Dec 14 12:36:27 UTC 2021
https://issues.dlang.org/show_bug.cgi?id=22596
moonlightsentinel at disroot.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Component|phobos |tools
Severity|blocker |normal
--- Comment #4 from moonlightsentinel at disroot.org ---
(In reply to Andrei Alexandrescu from comment #3)
> The symbol is not undefined because the documentation is nested inside the
> `canon` template, which is parameterized on v.
On a different page, not defined alongside the example.
Also ignores the fact that a documented unittests contributes an executable!
example (backed by run.dlang.io) to the offical documentation. Accepting such
tests would mean that examples would be broken unless modified by the user.
> Does this work properly with `make publictests`?
No, it would fail as expected. The definition / value of `v` is unknown to the
user who run this example on the website / in his code.
------
Such tests should probably provide a declaration of `v` with a default value.
This could probably be realized via tooling s.t. phobos can test different
versions while the website examples include an explicit `enum v = "..."`.
--
More information about the Digitalmars-d-bugs
mailing list