Bug 9473 – Unittest docs should each be in their own section

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-02-07T15:32:00Z
Last change time
2013-03-19T11:31:50Z
Keywords
pull
Assigned to
andrej.mitrovich
Creator
hsteoh
See also
http://d.puremagic.com/issues/show_bug.cgi?id=9727

Comments

Comment #0 by hsteoh — 2013-02-07T15:32:41Z
/** The magic function that can do anything. Example: --- void main(string[] args) { dotDotDotMagic(); } --- */ void dotDotDotMagic() { doAnything(); } /// Ddoc'd unittest unittest { int x=1; dotDotDotMagic(); assert(x==2); // wow! } ---------------------- Currently the output will contain two Example: sections, one following the other. They should be merged.
Comment #1 by andrej.mitrovich — 2013-02-07T16:35:02Z
The problem is there could already be multiple example sections, for example (pardon the pun): /** func Example: --- foo(); --- Example: --- bar(); --- */ void func() { } The output of this is: void func(); func Example: foo(); Example: bar(); It seemed only natural to do the same thing with unittest.
Comment #2 by hsteoh — 2013-02-07T16:53:47Z
OK. In that case, each unittest block should be in its own example section. Right now they are all under a single section, and it looks odd that the hand-written example section contains a couple of examples, followed by another example section with a couple of examples, with no clear reason for the break. It should either be a single example section for everything, or one section per example, so that it's consistent.
Comment #3 by andrej.mitrovich — 2013-02-07T17:02:22Z
Comment #4 by monarchdodra — 2013-03-16T02:58:04Z
Comment #5 by github-bugzilla — 2013-03-17T17:47:23Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/42f75e19f442f94fb480ad1ada4297b1bd38b7ac Fixes Issue 9473 - Unittest docs should each be in their own section. https://github.com/D-Programming-Language/dmd/commit/15b5b31c931b58139211f3aae774cacc86e5b11b Merge pull request #1639 from AndrejMitrovic/Fix9473 Issue 9473 - Unittest docs should each be in their own section.