Code That Says Exactly What It Means
Walter Bright
newshound2 at digitalmars.com
Fri Oct 31 00:50:54 UTC 2025
On 10/29/2025 8:48 PM, Steven Schveighoffer wrote:
> There has always been only ONE deficiency for this, and that is documented
> unittests being allowed to use private symbols in the module. But this is a
> unittest problem, and not a private problem.
>
> Note that the OPs argument against (non-documented) unittests being able to
> access private data is ironically something I view as a necessity -- I often
> test functions on a type and then examine the private details to make sure the
> state is as I expect it.
Since unittests aren't part of the finished program, preventing it from having
access is not terribly useful. It's like you can prefix statements with `debug`
when needing to override pure / @safe attributes.
More information about the Digitalmars-d
mailing list