diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/compile/tbindtypedesc.nim | 4 | ||||
-rw-r--r-- | tests/compile/tcomputedgoto.nim | 31 | ||||
-rw-r--r-- | tests/compile/tircbot.nim | 6 | ||||
-rw-r--r-- | tests/compile/tmacro2.nim | 2 | ||||
-rw-r--r-- | tests/patterns/tor.nim | 2 | ||||
-rw-r--r-- | tests/reject/t99bott.nim | 2 | ||||
-rw-r--r-- | tests/reject/tbind2.nim | 2 | ||||
-rw-r--r-- | tests/reject/tdisallowif.nim | 3 | ||||
-rw-r--r-- | tests/reject/teffects1.nim | 2 | ||||
-rw-r--r-- | tests/reject/tenummix.nim | 4 | ||||
-rw-r--r-- | tests/reject/tnot.nim | 3 | ||||
-rw-r--r-- | tests/reject/twrongconst.nim | 4 | ||||
-rw-r--r-- | tests/reject/twrongiter.nim | 2 |
13 files changed, 37 insertions, 30 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 diff --git a/tests/patterns/tor.nim b/tests/patterns/tor.nim index 7de1a7fa1..833418919 100644 --- a/tests/patterns/tor.nim +++ b/tests/patterns/tor.nim @@ -1,5 +1,5 @@ discard """ - output: '''110 + output: '''3060 true''' """ diff --git a/tests/reject/t99bott.nim b/tests/reject/t99bott.nim index 7ebfd61e9..d18cb0d5c 100644 --- a/tests/reject/t99bott.nim +++ b/tests/reject/t99bott.nim @@ -1,7 +1,7 @@ discard """ file: "t99bott.nim" line: 26 - errormsg: "constant expression expected" + errormsg: "cannot evaluate at compile time: bn" disabled: false """ ## 99 Bottles of Beer diff --git a/tests/reject/tbind2.nim b/tests/reject/tbind2.nim index 72a9844bb..e8e21ad02 100644 --- a/tests/reject/tbind2.nim +++ b/tests/reject/tbind2.nim @@ -1,6 +1,6 @@ discard """ file: "tbind2.nim" - line: 12 + line: 14 errormsg: "ambiguous call" """ # Test the new ``bind`` keyword for templates diff --git a/tests/reject/tdisallowif.nim b/tests/reject/tdisallowif.nim index 10f54288a..18dfd1c82 100644 --- a/tests/reject/tdisallowif.nim +++ b/tests/reject/tdisallowif.nim @@ -1,6 +1,7 @@ discard """ line: 24 errormsg: "usage of 'disallowIf' is a user-defined error" + disabled: true """ template optZero{x+x}(x: int): int = x*3 @@ -25,4 +26,4 @@ if s[0] != "hi": echo "do it" echo "more branches" else: - nil + discard diff --git a/tests/reject/teffects1.nim b/tests/reject/teffects1.nim index 1c6c4bed8..f5eb56dc8 100644 --- a/tests/reject/teffects1.nim +++ b/tests/reject/teffects1.nim @@ -1,5 +1,5 @@ discard """ - line: 1804 + line: 1840 file: "system.nim" errormsg: "can raise an unlisted exception: ref EIO" """ diff --git a/tests/reject/tenummix.nim b/tests/reject/tenummix.nim index f58e7989d..aaf0be2cb 100644 --- a/tests/reject/tenummix.nim +++ b/tests/reject/tenummix.nim @@ -1,6 +1,6 @@ discard """ - file: "system.nim" - line: 696 + file: "tenummix.nim" + line: 11 errormsg: "type mismatch" """ diff --git a/tests/reject/tnot.nim b/tests/reject/tnot.nim index 1985ef666..cd0f538e6 100644 --- a/tests/reject/tnot.nim +++ b/tests/reject/tnot.nim @@ -1,5 +1,6 @@ discard """ - file: "system.nim" + file: "tnot.nim" + line: 14 errormsg: "type mismatch" """ # BUG: following compiles, but should not: diff --git a/tests/reject/twrongconst.nim b/tests/reject/twrongconst.nim index 16fe3bff6..e5b8a15bd 100644 --- a/tests/reject/twrongconst.nim +++ b/tests/reject/twrongconst.nim @@ -1,6 +1,6 @@ discard """ - output: "Error: constant expression expected" - line: 7 + output: "Error: cannot evaluate at compile time: x" + line: 10 """ var x: array[100, char] diff --git a/tests/reject/twrongiter.nim b/tests/reject/twrongiter.nim index 2d2502a6a..33394219b 100644 --- a/tests/reject/twrongiter.nim +++ b/tests/reject/twrongiter.nim @@ -1,5 +1,5 @@ discard """ -line: 14 +line: 12 errormsg: "type mismatch" """ |