Bug 14383 – [ddoc] documented unittests don't work for module declaration

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-03-31T17:01:00Z
Last change time
2016-02-23T04:20:45Z
Keywords
ddoc, pull
Assigned to
nobody
Creator
code

Comments

Comment #0 by code — 2015-03-31T17:01:51Z
Sometimes it's useful to have an introductory example for a module, but documented unittest currently don't work for that. cat > mod.d << CODE /** My Module */ module mod; /// unittest { auto example = "usage"; } CODE dmd -D -c -o- mod Should produce the same output as this. cat > mod.d << CODE /** My Module ---- auto example = "usage"; ---- */ module mod; CODE
Comment #1 by andrei — 2015-05-07T18:48:00Z
Just hit this problem as well while documenting std.allocator, and found this as I was submitting.
Comment #2 by hsteoh — 2016-02-17T23:17:57Z
I got sick of waiting for somebody to fix this, so I did it myself: https://github.com/D-Programming-Language/dmd/pull/5465
Comment #3 by github-bugzilla — 2016-02-23T04:20:44Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/ee69cc59c06587a39c7f7603a30ab8a5d0fa2e4e Fix issue 14383: attach ddoc unittests to module declaration Turns out that the ddoc code already handles generating docs for module unittests; all that was missing was that the parser wasn't attaching these unittests to the module declaration. https://github.com/D-Programming-Language/dmd/commit/17ae1b37c42a1abed81cce68bcb6c0957e486e5a Merge pull request #5465 from quickfur/issue14383 Issue 14383: attach ddoc unittests to module declaration