Human unreadable documentation - the ugly seam between simple D and complex D

David Nadlinger via Digitalmars-d digitalmars-d at puremagic.com
Fri Mar 27 12:47:46 PDT 2015


On Friday, 27 March 2015 at 19:44:10 UTC, CraigDillabaugh wrote:
> That is a good point.  Ideally when building a library all the 
> 'examples' in the documentation should be built too to make 
> sure they are still valid.  Example code should be marked as 
> such, extracted and run through the compiler with each new 
> release.  I seem to recall reading in places that some D 
> resources (Ali's book perhaps) do this with their source code.
>
> As things stand that would be a mark in favor of unittests.

D has documented unittests (they appear in the docs as if part of 
the Examples section).  The only excuses for example code in 
Phobos to be untested are supposed to be that it is an incomplete 
fragment or that it is old code from before we had the feature.

  — David


More information about the Digitalmars-d mailing list