summary refs log tree commit diff stats
path: root/tests/vm/tnimnode.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2017-09-26 23:07:37 +0200
committerAndreas Rumpf <rumpf_a@web.de>2017-09-26 23:07:37 +0200
commit414e7eff0450d45de9c91f724c021d987b08c693 (patch)
tree0ece5508ad6296df0165eba8cc11baaac24d2b34 /tests/vm/tnimnode.nim
parent2bdbe97af1cd9046ba8028c5530e75025561afcc (diff)
downloadNim-414e7eff0450d45de9c91f724c021d987b08c693.tar.gz
make tests green again
Diffstat (limited to 'tests/vm/tnimnode.nim')
-rw-r--r--tests/vm/tnimnode.nim18
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/vm/tnimnode.nim b/tests/vm/tnimnode.nim
index e5a41e3c2..60e3189b0 100644
--- a/tests/vm/tnimnode.nim
+++ b/tests/vm/tnimnode.nim
@@ -15,9 +15,9 @@ static:
 
 proc checkNode(arg: NimNode; name: string): void {. compileTime .} =
   echo "checking ", name
-  
+
   assertEq arg.lispRepr , "StmtList(DiscardStmt(Empty()))"
-  
+
   node = arg
   nodeArray = [arg]
   nodeSeq[0] = arg
@@ -38,9 +38,9 @@ proc checkNode(arg: NimNode; name: string): void {. compileTime .} =
 static:
   # the root node that is used to generate the Ast
   var stmtList: NimNode
-  
+
   stmtList = newStmtList(nnkDiscardStmt.newTree(newEmptyNode()))
-  
+
   checkNode(stmtList, "direct construction")
 
 
@@ -50,12 +50,12 @@ macro foo(stmtList: untyped): untyped =
 foo:
   discard
 
-  
+
 static:
   stmtList = quote do:
     discard
 
-  checkNode(stmtList, "create with quote")
+  checkNode(newTree(nnkStmtList, stmtList), "create with quote")
 
 
 static:
@@ -64,13 +64,13 @@ static:
     for i in 0 ..< 10:
       discard
 
-  let innerBody = loop[0][2]
+  let innerBody = loop[2]
   innerBody.add newCall(ident"echo", newLit("Hello World"))
 
-  assertEq loop[0][2].lispRepr, innerBody.lispRepr
+  assertEq loop[2].lispRepr, innerBody.lispRepr
 
   echo "OK"
-  
+
 
 static:
   echo "testing creation of comment node"