parent
326a333c8b
commit
6e01be34ef
3 changed files with 38 additions and 1 deletions
22
tests/tools/tnimscriptwithmacro.nims
Normal file
22
tests/tools/tnimscriptwithmacro.nims
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
discard """
|
||||
cmd: "nim e $file"
|
||||
output: '''
|
||||
foobar
|
||||
nothing
|
||||
hallo
|
||||
"""
|
||||
|
||||
# this test ensures that the mode is resetted correctly to repr
|
||||
|
||||
import macros
|
||||
|
||||
macro foobar(): void =
|
||||
result = newCall(bindSym"echo", newLit("nothing"))
|
||||
|
||||
echo "foobar"
|
||||
|
||||
let x = 123
|
||||
|
||||
foobar()
|
||||
|
||||
exec "echo hallo"
|
||||
Loading…
Add table
Add a link
Reference in a new issue