summary refs log tree commit diff stats
path: root/tests/gc
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2019-05-27 15:57:20 +0200
committerAndreas Rumpf <rumpf_a@web.de>2019-05-27 21:29:02 +0200
commit795044ed2b9efd20ea220104ffc2894421930b2c (patch)
tree4845b33f4ec49a54c897c49101d8e3e32048f0fa /tests/gc
parent383147f5cb3db55cde451902d2c11c5cee9df075 (diff)
downloadNim-795044ed2b9efd20ea220104ffc2894421930b2c.tar.gz
make tests green again
Diffstat (limited to 'tests/gc')
-rw-r--r--tests/gc/gctest.nim11
1 files changed, 3 insertions, 8 deletions
diff --git a/tests/gc/gctest.nim b/tests/gc/gctest.nim
index 25d57ff0e..78b78934c 100644
--- a/tests/gc/gctest.nim
+++ b/tests/gc/gctest.nim
@@ -45,19 +45,14 @@ var
   flip: int
 
 proc newCaseNode(data: string): PCaseNode =
-  new(result)
   if flip == 0:
-    result.kind = nkStr
-    result.data = data
+    result = PCaseNode(kind: nkStr, data: data)
   else:
-    result.kind = nkWhole
-    result.unused = @["", "abc", "abdc"]
+    result = PCaseNode(kind: nkWhole, unused: @["", "abc", "abdc"])
   flip = 1 - flip
 
 proc newCaseNode(a, b: PCaseNode): PCaseNode =
-  new(result)
-  result.kind = nkList
-  result.sons = @[a, b]
+  result = PCaseNode(kind: nkList, sons: @[a, b])
 
 proc caseTree(lvl: int = 0): PCaseNode =
   if lvl == 3: result = newCaseNode("data item")