/**
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