Skip to content

Commit f7900f8

Browse files
committed
add tests
1 parent 2ce9838 commit f7900f8

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

tests/nimdoc/trunnableexamples.nim

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,31 @@ when true: # runnableExamples with rdoccmd
109109
# passing seq (to run with multiple compilation options)
110110
runnableExamples(@["-b:cpp", "-b:js"]): discard
111111

112+
runnableExamples:
113+
block: # bug #17279
114+
when int.sizeof == 8:
115+
let x = 0xffffffffffffffff
116+
doAssert x == -1
117+
118+
# bug #13491
119+
block:
120+
proc fun(): int = doAssert false
121+
doAssertRaises(AssertionError, (discard fun()))
122+
123+
block:
124+
template foo(body) = discard
125+
foo (discard)
126+
127+
block:
128+
template fn(body: untyped): untyped = true
129+
doAssert(fn do: nonexistant)
130+
import std/macros
131+
macro foo*(x, y) =
132+
result = newLetStmt(x[0][0], x[0][1])
133+
foo:
134+
a = 1
135+
do: discard
136+
112137
# also check for runnableExamples at module scope
113138
runnableExamples:
114139
block:

0 commit comments

Comments
 (0)