fix #13491 #17279 runnableExamples now don't get lost in translation (#17282)

* fix #13491 runnableExamples rendering
* fix a runnableExamples thanks to this bugfix
This commit is contained in:
Timothee Cour 2021-03-08 22:09:24 -08:00 • committed by GitHub
commit d161d27cdd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 70 additions and 27 deletions

View file

@ -109,6 +109,31 @@ when true: # runnableExamples with rdoccmd
# passing seq (to run with multiple compilation options)
runnableExamples(@["-b:cpp", "-b:js"]): discard
runnableExamples:
block: # bug #17279
when int.sizeof == 8:
let x = 0xffffffffffffffff
doAssert x == -1
# bug #13491
block:
proc fun(): int = doAssert false
doAssertRaises(AssertionError, (discard fun()))
block:
template foo(body) = discard
foo (discard)
block:
template fn(body: untyped): untyped = true
doAssert(fn do: nonexistant)
import std/macros
macro foo*(x, y) =
result = newLetStmt(x[0][0], x[0][1])
foo:
a = 1
do: discard
# also check for runnableExamples at module scope
runnableExamples:
block: