summary refs log tree commit diff stats
path: root/nimdoc/testproject
diff options
context:
space:
mode:
authorflywind <xzsflywind@gmail.com>2021-04-03 09:26:30 +0800
committerGitHub <noreply@github.com>2021-04-02 18:26:30 -0700
commita807233aebcd3759bc3e21b450ed89e1eb6ddace (patch)
tree5cd63e236735ccb37254c910866ad14ae91fe318 /nimdoc/testproject
parente35946f306c31d02869dfc4f191b76893b792700 (diff)
downloadNim-a807233aebcd3759bc3e21b450ed89e1eb6ddace.tar.gz
fix #17615(runnableExamples silently ignored if placed after some code) (#17619)
Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
Diffstat (limited to 'nimdoc/testproject')
-rw-r--r--nimdoc/testproject/expected/testproject.html4
-rw-r--r--nimdoc/testproject/testproject.nim4
2 files changed, 4 insertions, 4 deletions
diff --git a/nimdoc/testproject/expected/testproject.html b/nimdoc/testproject/expected/testproject.html
index ba1791d81..1ea9e172a 100644
--- a/nimdoc/testproject/expected/testproject.html
+++ b/nimdoc/testproject/expected/testproject.html
@@ -1016,7 +1016,9 @@ cz15
 <p><strong class="examples_text">Example:</strong></p>
 <pre class="listing"><span class="Keyword">discard</span><span class="Whitespace"> </span><span class="DecNumber">4</span></pre>ok5 ok5b
 <p><strong class="examples_text">Example:</strong></p>
-<pre class="listing"><span class="Identifier">assert</span><span class="Whitespace"> </span><span class="Identifier">true</span></pre>in or out?
+<pre class="listing"><span class="Identifier">assert</span><span class="Whitespace"> </span><span class="Identifier">true</span></pre>
+<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>in or out?
 
 </dd>
 <a id="testNimDocTrailingExample.t"></a>
diff --git a/nimdoc/testproject/testproject.nim b/nimdoc/testproject/testproject.nim
index 69edb0d23..6b82acb9b 100644
--- a/nimdoc/testproject/testproject.nim
+++ b/nimdoc/testproject/testproject.nim
@@ -330,13 +330,11 @@ when true: # (most) templates
     ## ok5
     ## ok5b
     runnableExamples: assert true
+    runnableExamples: discard 1
 
     ## in or out?
-    # this is an edge case; a newline separate last runnableExamples from 
-    # next doc comment but AST isnt' aware of it; this could change in future
     discard 8
     ## out
-    runnableExamples: discard 1
 
 when true: # issue #14473
   import std/[sequtils]