[Issue 11133] ddoc: documented unittest outside of version scope

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Dec 14 01:22:30 UTC 2017


https://issues.dlang.org/show_bug.cgi?id=11133

Jonathan M Davis <issues.dlang at jmdavisProg.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |issues.dlang at jmdavisProg.co
                   |                            |m

--- Comment #2 from Jonathan M Davis <issues.dlang at jmdavisProg.com> ---
Similarly, the unit tests don't end up in the docs in this code, and
version(D_Ddoc) isn't even involved:

==============
///
struct S
{
    /// Something about foo.
    version(Posix)
        alias Foo = int;
    else version(Windows)
        alias Foo = int;

    ///
    unittest
    {
        Foo foo;
    }
}
==============

Or at least, the unit test doesn't show up in the docs if you compile on a
POSIX system. I assume that it will show up if you compile on Windows, since if
I flip the versions, the unit test does show up. So, I guess that it considers
the unit test to go with the symbol in the else block and will only put the
test in the docs if  it's the last version that's taken.

I have a similar problem in my code with static ifs, so I think that this
problem applies to them too.

--


More information about the Digitalmars-d-bugs mailing list