summary refs log tree commit diff stats
path: root/tests/macros
diff options
context:
space:
mode:
authorTimothee Cour <timothee.cour2@gmail.com>2020-02-11 12:33:06 -0800
committerGitHub <noreply@github.com>2020-02-11 21:33:06 +0100
commiteec07b4e84d3418d171cf08aa8a02f380a39b78e (patch)
tree6c240454769f5d82e9febb3e79e13586d56a3319 /tests/macros
parentf6d45b40a51d8b336acaae4cddcbca825e11c0ba (diff)
downloadNim-eec07b4e84d3418d171cf08aa8a02f380a39b78e.tar.gz
fix several bugs with `repr` (#13386)
Diffstat (limited to 'tests/macros')
-rw-r--r--tests/macros/tdumpast.nim17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/macros/tdumpast.nim b/tests/macros/tdumpast.nim
index 3a26ffd2f..b9d224ab8 100644
--- a/tests/macros/tdumpast.nim
+++ b/tests/macros/tdumpast.nim
@@ -31,3 +31,20 @@ dumpAST:
 
   proc sub(x, y: int): int = return x - y
 
+macro fun() =
+  let n = quote do:
+    1+1 == 2
+  doAssert n.repr == "1 + 1 == 2", n.repr
+fun()
+
+macro fun2(): untyped =
+  let n = quote do:
+    1 + 2 * 3 == 1 + 6
+  doAssert n.repr == "1 + 2 * 3 == 1 + 6", n.repr
+fun2()
+
+macro fun3(): untyped =
+  let n = quote do:
+    int | float | array | seq | object | ptr | pointer | float32
+  doAssert n.repr == "int | float | array | seq | object | ptr | pointer | float32", n.repr
+fun3()