summary refs log tree commit diff stats
path: root/tests/compile
diff options
context:
space:
mode:
Diffstat (limited to 'tests/compile')
-rw-r--r--tests/compile/tbindtypedesc.nim4
-rw-r--r--tests/compile/tcomputedgoto.nim31
-rw-r--r--tests/compile/tircbot.nim6
-rw-r--r--tests/compile/tmacro2.nim2
4 files changed, 24 insertions, 19 deletions
diff --git a/tests/compile/tbindtypedesc.nim b/tests/compile/tbindtypedesc.nim
index dd4ef854c..4ebfd12bb 100644
--- a/tests/compile/tbindtypedesc.nim
+++ b/tests/compile/tbindtypedesc.nim
@@ -44,6 +44,10 @@ good(genericParamOnce(TFoo, TFoo))
 bad(genericParamOnce(string, int))
 bad(genericParamOnce(TFoo, float))
 
+type
+  type1 = typedesc
+  type2 = typedesc
+
 proc typePairs(A, B: type1; C, D: type2) = nil
 
 good(typePairs(int, int, TFoo, TFOO))
diff --git a/tests/compile/tcomputedgoto.nim b/tests/compile/tcomputedgoto.nim
index 2c3b4bbd4..b21fc07a3 100644
--- a/tests/compile/tcomputedgoto.nim
+++ b/tests/compile/tcomputedgoto.nim
@@ -1,16 +1,16 @@
 discard """
-  output: '''yeah A
-yeah A
-yeah CD
-yeah CD
-yeah A
-yeah CD
-yeah CD
-yeah A
-yeah B
-yeah A
-yeah A
-yeah A'''
+  output: '''yeah A enumB
+yeah A enumB
+yeah CD enumD
+yeah CD enumE
+yeah A enumB
+yeah CD enumE
+yeah CD enumD
+yeah A enumB
+yeah B enumC
+yeah A enumB
+yeah A enumB
+yeah A enumB'''
 """
 
 type
@@ -32,13 +32,14 @@ proc vm() =
   while true:
     {.computedGoto.}
     let instr = instructions[pc]
+    let ra = instr.succ # instr.regA
     case instr
     of enumA:
-      echo "yeah A"
+      echo "yeah A ", ra
     of enumC, enumD:
-      echo "yeah CD"
+      echo "yeah CD ", ra
     of enumB:
-      echo "yeah B"
+      echo "yeah B ", ra
     of enumE:
       break
     inc(pc)
diff --git a/tests/compile/tircbot.nim b/tests/compile/tircbot.nim
index d16c99b69..6008838ff 100644
--- a/tests/compile/tircbot.nim
+++ b/tests/compile/tircbot.nim
@@ -257,7 +257,7 @@ proc limitCommitMsg(m: string): string =
 proc handleWebMessage(state: PState, line: string) =
   echo("Got message from hub: " & line)
   var json = parseJson(line)
-  if json.existsKey("payload"):
+  if json.hasKey("payload"):
     for i in 0..min(4, json["payload"]["commits"].len-1):
       var commit = json["payload"]["commits"][i]
       # Create the message
@@ -273,8 +273,8 @@ proc handleWebMessage(state: PState, line: string) =
 
       # Send message to #nimrod.
       state.ircClient.privmsg(joinChans[0], message)
-  elif json.existsKey("redisinfo"):
-    assert json["redisinfo"].existsKey("port")
+  elif json.hasKey("redisinfo"):
+    assert json["redisinfo"].hasKey("port")
     #let redisPort = json["redisinfo"]["port"].num
     state.dbConnected = true
 
diff --git a/tests/compile/tmacro2.nim b/tests/compile/tmacro2.nim
index e7bc648db..39324e497 100644
--- a/tests/compile/tmacro2.nim
+++ b/tests/compile/tmacro2.nim
@@ -26,7 +26,7 @@ macro importImpl_forward(name, returns): stmt {.immediate.} =
   p2.add newIdentNode("errors")
   p2.add newNimNode(nnkVarTy)
   p2.add newNimNode(nnkEmpty)
-  p2[1].add newNimNOde(nnkBracketExpr)
+  p2[1].add newNimNode(nnkBracketExpr)
   p2[1][0].add newIdentNode("seq")
   p2[1][0].add newIdentNode("string")
   res[3].add p2