Example unittests?

Steven Schveighoffer schveiguy at gmail.com
Mon Oct 17 14:11:49 UTC 2022


On 10/16/22 11:07 PM, WebFreak001 wrote:

> So I'm asking you what do you think of this issue?
> 
> 1. Should we get this PR in as-is, effectively letting library authors 
> decide if they want to optimize for auto complete readability (possibly 
> worsening the documentation quality), but always giving the user full 
> information
> 2. Don't add this feature to DCD, only keep the ddoc string examples in 
> (which don't get auto-tested, but could be, if we added a dub feature 
> and create all the tooling there)
> 3. Add explicit example blocks (e.g. `@example unittest { ... }`) - this 
> would require a `example` symbol to be defined somewhere though, or a 
> special case in the compiler, like with `nogc` and `live` (also some 
> kind of standard UDA library might make in general, for things like 
> D-Scanner as well)

What about showing a limited number of examples, configurable in the 
settings? Like show first 2 examples, and you can up that number if you 
want.

Also, I don't know about the UI possabilities here, but could you show a 
limited number of examples with a button to show the rest?

-Steve


More information about the Digitalmars-d mailing list