documentable unittest

Andrej Mitrovic andrej.mitrovich at gmail.com
Fri Feb 8 10:08:12 PST 2013


On 2/7/13, Andrei Alexandrescu <SeeWebsiteForEmail at erdani.org> wrote:
> I'm very happy that this will be part of the upcoming release:
> https://github.com/D-Programming-Language/dmd/pull/1342 (see also
> http://d.puremagic.com/issues/show_bug.cgi?id=2630) allows defining
> unittests that simultaneously work as documentation. This is a great way
> to simultaneously write meaningful tests and good documentation examples.
>
> If you want to help, feel free to hop on the Phobos documentation and
> convert some of it to use the new feature.

There's a few bugs for which pull requests exist. Here's the state of things:

https://github.com/D-Programming-Language/dmd/pull/1641 will be able
to document the body of the unittest while preserving both formatting
(Issue 9475) and comments (Issue 9472). However it requires Kenji's
https://github.com/D-Programming-Language/dmd/pull/1377 to be pulled
because it will allow me to properly unindent code samples so they
line-up nicely.

https://github.com/D-Programming-Language/dmd/pull/1639 will make sure
each documented sample is in its own "Example:" section.

https://github.com/D-Programming-Language/dmd/pull/1646 will make sure
version statements don't break documented unittests.

Each of these might need a rebase from my end after each one is
pulled. But the most important thing is to merge Kenji's pull first so
I can start work ASAP before Walter decides to release DMD.


More information about the Digitalmars-d mailing list