summary refs log tree commit diff stats
path: root/tests/tools/tnimscriptwithmacro.nims
diff options
context:
space:
mode:
Diffstat (limited to 'tests/tools/tnimscriptwithmacro.nims')
-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"