automatic code examples in documentation

Tomek Sowiński just at ask.me
Fri Oct 15 15:48:07 PDT 2010


Lutger napisał:

> for reference: http://d.puremagic.com/issues/show_bug.cgi?id=2630
> 
> Tomasz Sowiński raises the point that each unittest should test the
> preceding declaration. I think that's a little inflexible, instead the
> following could work:
> 
> - unittests marked with 'ditto' will document the preceding declaration

Well, a unittest making a trial run of the preceding declaration is a convention, natural and 
widely adopted. That well-trodden path deserves to be acknowledged by the doc generator.

Good thing about this idea is that *nothing* changes, no extra gimmicks around unittest 
blocks, the code's natural flow is intact.

> - unittest not marked with ditto will be put in a hardwired macro like
> BODY is, so that you have control where it gets put in the generated
> documentation.

Hm.. would the hardwired macro name be same for all unittests? If so, the notion of implicit 
ownership by the preceding declaration is necessary so that the names wouldn't mix up.

-- 
Tomek


More information about the Digitalmars-d mailing list