Postmortem: Template unittests are bad & you shouldn't catch Error

Steven Schveighoffer schveiguy at gmail.com
Thu Oct 22 19:19:18 UTC 2020


On 10/22/20 12:39 PM, Paul Backus wrote:
> On Thursday, 22 October 2020 at 16:18:14 UTC, H. S. Teoh wrote:
>> 2) Ddoc's unittests require unittest blocks to be attached to the 
>> symbol they're documenting. So you pretty much have no choice, unless 
>> you use Phobos StdDdoc hack (ugh):
> 
> It seems like the obvious solution is to remove this limitation. For 
> example, maybe the documentation generator should allow you to attach a 
> unittest to any symbol in the same module, regardless of where it 
> appears in the code:
> 
> /// Documents: Nullable.get
> unittest
> {
>      /* etc. */
> }

This would be sufficient!

-Steve


More information about the Digitalmars-d mailing list