summary refs log tree commit diff stats
path: root/tests/tools
diff options
context:
space:
mode:
authorArne Döring <arne.doering@gmx.net>2019-08-31 19:32:59 +0200
committerAndreas Rumpf <rumpf_a@web.de>2019-08-31 19:32:59 +0200
commit6e01be34efd60869c7905b1effcc47880cedfb6d (patch)
tree02fe3dd7f7d43215ffea7e0aef138db5852ae8e2 /tests/tools
parent326a333c8b85d4cb0a8332e8ce292bf7bf296104 (diff)
downloadNim-6e01be34efd60869c7905b1effcc47880cedfb6d.tar.gz
fixes #11903 (#11908)
Diffstat (limited to 'tests/tools')
-rw-r--r--tests/tools/tnimscriptwithmacro.nims22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/tools/tnimscriptwithmacro.nims b/tests/tools/tnimscriptwithmacro.nims
new file mode 100644
index 000000000..8b97f0769
--- /dev/null
+++ b/tests/tools/tnimscriptwithmacro.nims
@@ -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"