[Issue 10519] New: Stray-paren in doc-unittest code generates wrong document

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jul 1 01:08:00 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=10519

           Summary: Stray-paren in doc-unittest code generates wrong
                    document
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: ddoc
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: k.hara.pg at gmail.com


--- Comment #0 from Kenji Hara <k.hara.pg at gmail.com> 2013-07-01 01:07:59 PDT ---
The example code generates wrong html.

Code:
----
///
void foo() {}

///
unittest
{
    auto s = "1 + (2 * (3 + 1 / 2)";
    assert(!balancedParens(s, '(', ')'));
}
----


Generated test.html
----

<html><head>
        <META http-equiv="content-type" content="text/html; charset=utf-8">
        <title>test</title>
        </head><body>
        <h1>test</h1>
        <!-- Generated by Ddoc from test.d -->
<br><br>
$(DDOC_MODULE_MEMBERS
<dt><big><a name="foo"></a>void <u>foo</u>();
</big></dt>
<dd><b>Examples:</b><br>
<pre class="d_code">
<font color=blue>auto</font> s = <font color=red>"1 + (2 * (3 + 1 / 2)");
<font color=blue>assert</font>(!balancedParens(s, '(', ')'));
</font>
</pre><br><br>

</dd>

        <hr><small>Page generated by <a
href="http://dlang.org/ddoc.html">Ddoc</a>. </small>
        </body></html>
----

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list