Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
timotheecour committed May 28, 2020
1 parent d8aa3e3 commit 0811b41
Show file tree
Hide file tree
Showing 5 changed files with 109 additions and 2 deletions.
11 changes: 11 additions & 0 deletions nimdoc/testproject/expected/subdir/subdir_b/utils.html
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ <h1 class="title">subdir/subdir_b/utils</h1>
title="aEnum(): untyped"><wbr />a<wbr />Enum<span class="attachedType"></span></a></li>
<li><a class="reference" href="#bEnum.t"
title="bEnum(): untyped"><wbr />b<wbr />Enum<span class="attachedType"></span></a></li>
<li><a class="reference" href="#fromUtilsGen.t"
title="fromUtilsGen(): untyped"><wbr />from<wbr />Utils<wbr />Gen<span class="attachedType"></span></a></li>

</ul>
</li>
Expand Down Expand Up @@ -193,6 +195,15 @@ <h1><a class="toc-backref" href="#18">Templates</a></h1>



</dd>
<a id="fromUtilsGen.t"></a>
<dt><pre><span class="Keyword">template</span> <a href="#fromUtilsGen.t"><span class="Identifier">fromUtilsGen</span></a><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">untyped</span></pre></dt>
<dd>

this should be shown in utils.html
<p><strong class="examples_text">Example:</strong></p>
<pre class="listing"><span class="Identifier">assert</span><span class="Whitespace"> </span><span class="DecNumber">3</span><span class="Operator">*</span><span class="DecNumber">2</span><span class="Whitespace"> </span><span class="Operator">==</span><span class="Whitespace"> </span><span class="DecNumber">6</span></pre>ditto

</dd>

</dl></div>
Expand Down
1 change: 1 addition & 0 deletions nimdoc/testproject/expected/subdir/subdir_b/utils.idx
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ SomeType subdir/subdir_b/utils.html#SomeType utils: SomeType
someType subdir/subdir_b/utils.html#someType_2 utils: someType(): SomeType
aEnum subdir/subdir_b/utils.html#aEnum.t utils: aEnum(): untyped
bEnum subdir/subdir_b/utils.html#bEnum.t utils: bEnum(): untyped
fromUtilsGen subdir/subdir_b/utils.html#fromUtilsGen.t utils: fromUtilsGen(): untyped
75 changes: 73 additions & 2 deletions nimdoc/testproject/expected/testproject.html
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ <h1 class="title">testproject</h1>
title="baz[T](a, b: T): T"><wbr />baz<span class="attachedType"></span></a></li>
<li><a class="reference" href="#buzz%2CT%2CT"
title="buzz[T](a, b: T): T"><wbr />buzz<span class="attachedType"></span></a></li>
<li><a class="reference" href="#fromUtils3"
title="fromUtils3()"><wbr />from<wbr />Utils3<span class="attachedType"></span></a></li>
<li><a class="reference" href="#isValid%2CT"
title="isValid[T](x: T): bool"><wbr />is<wbr />Valid<span class="attachedType"></span></a></li>
<li><a class="reference" href="#z1"
Expand Down Expand Up @@ -184,6 +186,8 @@ <h1 class="title">testproject</h1>
title="baz()"><wbr />baz<span class="attachedType"></span></a></li>
<li><a class="reference" href="#z17"
title="z17()"><wbr />z17<span class="attachedType"></span></a></li>
<li><a class="reference" href="#p1"
title="p1()"><wbr />p1<span class="attachedType"></span></a></li>

</ul>
</li>
Expand All @@ -195,6 +199,14 @@ <h1 class="title">testproject</h1>

</ul>
</li>
<li>
<a class="reference reference-toplevel" href="#15" id="65">Iterators</a>
<ul class="simple simple-toc-section">
<li><a class="reference" href="#fromUtils1.i"
title="fromUtils1(): int"><wbr />from<wbr />Utils1<span class="attachedType"></span></a></li>

</ul>
</li>
<li>
<a class="reference reference-toplevel" href="#17" id="67">Macros</a>
<ul class="simple simple-toc-section">
Expand All @@ -210,7 +222,9 @@ <h1 class="title">testproject</h1>
<li>
<a class="reference reference-toplevel" href="#18" id="68">Templates</a>
<ul class="simple simple-toc-section">
<li><a class="reference" href="#z6t.t"
<li><a class="reference" href="#fromUtils2.t"
title="fromUtils2()"><wbr />from<wbr />Utils2<span class="attachedType"></span></a></li>
<li><a class="reference" href="#z6t.t"
title="z6t(): int"><wbr />z6t<span class="attachedType"></span></a></li>
<li><a class="reference" href="#foo.t%2CSomeType%2CSomeType"
title="foo(a, b: SomeType)"><wbr />foo<span class="attachedType"></span></a></li>
Expand Down Expand Up @@ -242,7 +256,9 @@ <h1 class="title">testproject</h1>
<p><strong class="examples_text">Example:</strong></p>
<pre class="listing"><span class="Keyword">discard</span><span class="Whitespace"> </span><span class="StringLit">&quot;in top2&quot;</span></pre>top2 after
<p><strong class="examples_text">Example:</strong></p>
<pre class="listing"><span class="Keyword">discard</span><span class="Whitespace"> </span><span class="StringLit">&quot;in top3&quot;</span></pre>top3 after</p>
<pre class="listing"><span class="Keyword">discard</span><span class="Whitespace"> </span><span class="StringLit">&quot;in top3&quot;</span></pre>top3 after
<p><strong class="examples_text">Example:</strong></p>
<pre class="listing"><span class="Identifier">assert</span><span class="Whitespace"> </span><span class="DecNumber">3</span><span class="Operator">*</span><span class="DecNumber">2</span><span class="Whitespace"> </span><span class="Operator">==</span><span class="Whitespace"> </span><span class="DecNumber">6</span></pre></p>
<div class="section" id="6">
<h1><a class="toc-backref" href="#6">Imports</a></h1>
<dl class="item">
Expand Down Expand Up @@ -351,6 +367,15 @@ <h1><a class="toc-backref" href="#12">Procs</a></h1>

This is deprecated with a message.

</dd>
<a id="fromUtils3"></a>
<dt><pre><span class="Keyword">proc</span> <a href="#fromUtils3"><span class="Identifier">fromUtils3</span></a><span class="Other">(</span><span class="Other">)</span> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
<dd>

came form utils but should be shown where <tt class="docutils literal"><span class="pre">fromUtilsGen</span></tt> is called
<p><strong class="examples_text">Example:</strong></p>
<pre class="listing"><span class="Keyword">discard</span><span class="Whitespace"> </span><span class="DecNumber">1</span></pre>

</dd>
<a id="isValid,T"></a>
<dt><pre><span class="Keyword">proc</span> <a href="#isValid%2CT"><span class="Identifier">isValid</span></a><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">x</span><span class="Other">:</span> <span class="Identifier">T</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">bool</span></pre></dt>
Expand Down Expand Up @@ -477,6 +502,29 @@ <h1><a class="toc-backref" href="#12">Procs</a></h1>
<p><strong class="examples_text">Example:</strong></p>
<pre class="listing"><span class="Keyword">discard</span><span class="Whitespace"> </span><span class="DecNumber">1</span></pre>rest

</dd>
<a id="p1"></a>
<dt><pre><span class="Keyword">proc</span> <a href="#p1"><span class="Identifier">p1</span></a><span class="Other">(</span><span class="Other">)</span> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
<dd>

cp1
<p><strong class="examples_text">Example:</strong></p>
<pre class="listing"><span class="Identifier">doAssert</span><span class="Whitespace"> </span><span class="DecNumber">1</span><span class="Whitespace"> </span><span class="Operator">==</span><span class="Whitespace"> </span><span class="DecNumber">1</span><span class="Whitespace"> </span><span class="Comment"># regular comments work here</span></pre>c4
<p><strong class="examples_text">Example:</strong></p>
<pre class="listing"><span class="Comment"># c5 regular comments before 1st token work</span><span class="Whitespace">
</span><span class="Comment"># regular comment</span><span class="Whitespace">
</span><span class="LongComment">#[
nested regular comment
]#</span><span class="Whitespace">
</span><span class="Identifier">doAssert</span><span class="Whitespace"> </span><span class="DecNumber">2</span><span class="Whitespace"> </span><span class="Operator">==</span><span class="Whitespace"> </span><span class="DecNumber">2</span><span class="Whitespace"> </span><span class="Comment"># c8</span><span class="Whitespace">
</span><span class="Comment">## this is a non-nested doc comment</span><span class="Whitespace">

</span><span class="LongComment">##[
this is a nested doc comment
]##</span><span class="Whitespace">
</span><span class="Keyword">discard</span><span class="Whitespace"> </span><span class="StringLit">&quot;c9&quot;</span><span class="Whitespace">
</span><span class="Comment"># also work after</span></pre>

</dd>

</dl></div>
Expand All @@ -491,6 +539,22 @@ <h1><a class="toc-backref" href="#13">Funcs</a></h1>

</dd>

</dl></div>
<div class="section" id="15">
<h1><a class="toc-backref" href="#15">Iterators</a></h1>
<dl class="item">
<a id="fromUtils1.i"></a>
<dt><pre><span class="Keyword">iterator</span> <a href="#fromUtils1.i"><span class="Identifier">fromUtils1</span></a><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">int</span> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
<dd>


<p><strong class="examples_text">Example:</strong></p>
<pre class="listing"><span class="Comment"># ok1</span><span class="Whitespace">
</span><span class="Identifier">assert</span><span class="Whitespace"> </span><span class="DecNumber">1</span><span class="Whitespace"> </span><span class="Operator">==</span><span class="Whitespace"> </span><span class="DecNumber">1</span><span class="Whitespace">
</span><span class="Comment"># ok2</span></pre>

</dd>

</dl></div>
<div class="section" id="17">
<h1><a class="toc-backref" href="#17">Macros</a></h1>
Expand Down Expand Up @@ -525,6 +589,13 @@ <h1><a class="toc-backref" href="#17">Macros</a></h1>
<div class="section" id="18">
<h1><a class="toc-backref" href="#18">Templates</a></h1>
<dl class="item">
<a id="fromUtils2.t"></a>
<dt><pre><span class="Keyword">template</span> <a href="#fromUtils2.t"><span class="Identifier">fromUtils2</span></a><span class="Other">(</span><span class="Other">)</span></pre></dt>
<dd>

ok3

</dd>
<a id="z6t.t"></a>
<dt><pre><span class="Keyword">template</span> <a href="#z6t.t"><span class="Identifier">z6t</span></a><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">int</span></pre></dt>
<dd>
Expand Down
4 changes: 4 additions & 0 deletions nimdoc/testproject/expected/testproject.idx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ aVariable testproject.html#aVariable testproject: aVariable
A testproject.html#A testproject: A
B testproject.html#B testproject: B
someFunc testproject.html#someFunc testproject: someFunc()
fromUtils1 testproject.html#fromUtils1.i testproject: fromUtils1(): int
fromUtils2 testproject.html#fromUtils2.t testproject: fromUtils2()
fromUtils3 testproject.html#fromUtils3 testproject: fromUtils3()
isValid testproject.html#isValid,T testproject: isValid[T](x: T): bool
enumValueA2 testproject.html#enumValueA2 Foo.enumValueA2
Foo testproject.html#Foo testproject: Foo
Expand All @@ -28,6 +31,7 @@ z12 testproject.html#z12 testproject: z12(): int
z13 testproject.html#z13 testproject: z13()
baz testproject.html#baz testproject: baz()
z17 testproject.html#z17 testproject: z17()
p1 testproject.html#p1 testproject: p1()
bar testproject.html#bar.m testproject: bar(): untyped
z16 testproject.html#z16.m testproject: z16()
z18 testproject.html#z18.m testproject: z18(): int
Expand Down
20 changes: 20 additions & 0 deletions nimdoc/testproject/expected/theindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,22 @@ <h1 class="title">Index</h1>
<li><a class="reference external"
data-doc-search-tag="testproject: foo(a, b: SomeType)" href="testproject.html#foo.t%2CSomeType%2CSomeType">testproject: foo(a, b: SomeType)</a></li>
</ul></dd>
<dt><a name="fromUtils1" href="#fromUtils1"><span>fromUtils1:</span></a></dt><dd><ul class="simple">
<li><a class="reference external"
data-doc-search-tag="testproject: fromUtils1(): int" href="testproject.html#fromUtils1.i">testproject: fromUtils1(): int</a></li>
</ul></dd>
<dt><a name="fromUtils2" href="#fromUtils2"><span>fromUtils2:</span></a></dt><dd><ul class="simple">
<li><a class="reference external"
data-doc-search-tag="testproject: fromUtils2()" href="testproject.html#fromUtils2.t">testproject: fromUtils2()</a></li>
</ul></dd>
<dt><a name="fromUtils3" href="#fromUtils3"><span>fromUtils3:</span></a></dt><dd><ul class="simple">
<li><a class="reference external"
data-doc-search-tag="testproject: fromUtils3()" href="testproject.html#fromUtils3">testproject: fromUtils3()</a></li>
</ul></dd>
<dt><a name="fromUtilsGen" href="#fromUtilsGen"><span>fromUtilsGen:</span></a></dt><dd><ul class="simple">
<li><a class="reference external"
data-doc-search-tag="utils: fromUtilsGen(): untyped" href="subdir/subdir_b/utils.html#fromUtilsGen.t">utils: fromUtilsGen(): untyped</a></li>
</ul></dd>
<dt><a name="isValid" href="#isValid"><span>isValid:</span></a></dt><dd><ul class="simple">
<li><a class="reference external"
data-doc-search-tag="testproject: isValid[T](x: T): bool" href="testproject.html#isValid%2CT">testproject: isValid[T](x: T): bool</a></li>
Expand All @@ -157,6 +173,10 @@ <h1 class="title">Index</h1>
<li><a class="reference external"
data-doc-search-tag="testproject: myfn()" href="testproject.html#myfn.t">testproject: myfn()</a></li>
</ul></dd>
<dt><a name="p1" href="#p1"><span>p1:</span></a></dt><dd><ul class="simple">
<li><a class="reference external"
data-doc-search-tag="testproject: p1()" href="testproject.html#p1">testproject: p1()</a></li>
</ul></dd>
<dt><a name="someFunc" href="#someFunc"><span>someFunc:</span></a></dt><dd><ul class="simple">
<li><a class="reference external"
data-doc-search-tag="testproject: someFunc()" href="testproject.html#someFunc">testproject: someFunc()</a></li>
Expand Down

0 comments on commit 0811b41

Please sign in to comment.