https://issues.dlang.org/show_bug.cgi?id=22596
--- Comment #6 from [email protected] --- (In reply to Andrei Alexandrescu from comment #5) > Allow me to repeat to make sure I understand correctly: no documentation > unittest nested inside a template in phobos could ever access the template > parameters. The reason is that those unittests are transformed into runnable > examples on the website, which are at the top level (hence have no access to > the enclosing template's arguments). > > That makes sense, I assume it's documented somewhere. Indeed, but note that this restriction also applies to aggregates for the same reason (=> example that can be copy + pasted without additional requirements). > However I see it more of a limitation of the way we go about runnable > unittests than a "nothing to be seen here" situation. > > [...] > > Well the problem is a tad deeper. The tests need to be run for all versions > of the standard, that's the whole point of putting them in there. Having > them check all versions of the standard is great leverage. That we can't do > that is a serious issue. The real problem here seems to be a different understanding of documented unittests. IMO a documented unittests should be an example that demonstrates the usage of a function/template/... in the most simple way possible without any strings attached. Your description matches a great test but doesn't sound like a good example. > Let's leave this open in search for a good solution. Providing a default version as outline above could be an acceptable compromise. --
