diff options
author | Ian <ianmcxa@users.noreply.github.com> | 2018-10-30 01:30:39 -0400 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2018-10-30 06:30:39 +0100 |
commit | 5ddeead29cfb277c6ff094ce5b3e6186977db8d3 (patch) | |
tree | 91e23dbae5340a62ca2ee01aec89d1dc24891b19 /tests/vm/tissues.nim | |
parent | 1b17c9f693754b69b249ca604533dccb2a421fab (diff) | |
download | Nim-5ddeead29cfb277c6ff094ce5b3e6186977db8d3.tar.gz |
#9348 Merge some small test files (#9561)
* Consolidated types issue tests * Consolidated vm issue tests
Diffstat (limited to 'tests/vm/tissues.nim')
-rw-r--r-- | tests/vm/tissues.nim | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/vm/tissues.nim b/tests/vm/tissues.nim new file mode 100644 index 000000000..021b902ad --- /dev/null +++ b/tests/vm/tissues.nim @@ -0,0 +1,30 @@ +discard """ + nimout: "(Field0: 2, Field1: 2, Field2: 2, Field3: 2)" +""" + +import macros + +block t9043: + proc foo[N: static[int]](dims: array[N, int])= + const N1 = N + const N2 = dims.len + static: echo (N, dims.len, N1, N2) + + foo([1, 2]) + +block t4952: + proc doCheck(tree: NimNode) = + let res: tuple[n: NimNode] = (n: tree) + assert: tree.kind == res.n.kind + for sub in tree: + doCheck(sub) + + macro id(body: untyped): untyped = + doCheck(body) + + id(foo((i: int))) + + static: + let tree = newTree(nnkExprColonExpr) + let t = (n: tree) + assert: t.n.kind == tree.kind |