diff options
Diffstat (limited to 'tests')
36 files changed, 219 insertions, 78 deletions
diff --git a/tests/actiontable/tactiontable2.nim b/tests/actiontable/tactiontable2.nim index 00b427603..878356321 100644 --- a/tests/actiontable/tactiontable2.nim +++ b/tests/actiontable/tactiontable2.nim @@ -1,6 +1,6 @@ discard """ line: 21 - errormsg: "invalid type: 'TTable'" + errormsg: "invalid type: 'TTable[string, proc (string)]'" """ import tables diff --git a/tests/ambsym/mambsym1.nim b/tests/ambsym/mambsym1.nim index cf8ac5242..d9d57b5e5 100644 --- a/tests/ambsym/mambsym1.nim +++ b/tests/ambsym/mambsym1.nim @@ -7,4 +7,4 @@ type proc ha() = var x: TExport # no error - nil + discard diff --git a/tests/ambsym/mambsys1.nim b/tests/ambsym/mambsys1.nim index 5472b5ae4..04f9561d3 100644 --- a/tests/ambsym/mambsys1.nim +++ b/tests/ambsym/mambsys1.nim @@ -4,4 +4,4 @@ type TExport* = enum x, y, z proc foo*(x: int) = - nil + discard diff --git a/tests/ambsym/mambsys2.nim b/tests/ambsym/mambsys2.nim index 395425b86..d59706865 100644 --- a/tests/ambsym/mambsys2.nim +++ b/tests/ambsym/mambsys2.nim @@ -1,4 +1,4 @@ type TExport* = enum x, y, z # exactly the same type! -proc foo*(x: int) = nil +proc foo*(x: int) = discard diff --git a/tests/async/tasyncawait.nim b/tests/async/tasyncawait.nim new file mode 100644 index 000000000..bde5bf8c8 --- /dev/null +++ b/tests/async/tasyncawait.nim @@ -0,0 +1,64 @@ +discard """ + file: "tasyncawait.nim" + cmd: "nimrod cc --hints:on $# $#" + output: "5000" +""" +import asyncio2, sockets2, net, strutils + +var disp = newDispatcher() +var msgCount = 0 + +const + swarmSize = 50 + messagesToSend = 100 + +var clientCount = 0 + +proc sendMessages(disp: PDispatcher, client: TSocketHandle): PFuture[int] {.async.} = + for i in 0 .. <messagesToSend: + discard await disp.send(client, "Message " & $i & "\c\L") + +proc launchSwarm(disp: PDispatcher, port: TPort): PFuture[int] {.async.} = + for i in 0 .. <swarmSize: + var sock = socket() + #disp.register(sock) + discard await disp.connect(sock, "localhost", port) + when true: + discard await sendMessages(disp, sock) + sock.close() + else: + # Issue #932: https://github.com/Araq/Nimrod/issues/932 + var msgFut = sendMessages(disp, sock) + msgFut.callback = + proc () = + sock.close() + +proc readMessages(disp: PDispatcher, client: TSocketHandle): PFuture[int] {.async.} = + while true: + var line = await disp.recvLine(client) + if line == "": + client.close() + clientCount.inc + break + else: + if line.startswith("Message "): + msgCount.inc + else: + doAssert false + +proc createServer(disp: PDispatcher, port: TPort): PFuture[int] {.async.} = + var server = socket() + #disp.register(server) + server.bindAddr(port) + server.listen() + while true: + discard readMessages(disp, await disp.accept(server)) + +discard disp.createServer(TPort(10335)) +discard disp.launchSwarm(TPort(10335)) +while true: + disp.poll() + if clientCount == swarmSize: break + +assert msgCount == swarmSize * messagesToSend +echo msgCount diff --git a/tests/casestmt/tcasestm.nim b/tests/casestmt/tcasestm.nim index 003ec6e50..b033b98ec 100644 --- a/tests/casestmt/tcasestm.nim +++ b/tests/casestmt/tcasestm.nim @@ -19,8 +19,8 @@ of eB, eC: write(stdout, "b or c") case x of "Andreas", "Rumpf": write(stdout, "Hallo Meister!") of "aa", "bb": write(stdout, "Du bist nicht mein Meister") -of "cc", "hash", "when": nil -of "will", "it", "finally", "be", "generated": nil +of "cc", "hash", "when": discard +of "will", "it", "finally", "be", "generated": discard var z = case i of 1..5, 8, 9: "aa" diff --git a/tests/concurrency/tnodeadlocks.nim b/tests/concurrency/tnodeadlocks.nim index 18fdca3e9..3f27e24f6 100644 --- a/tests/concurrency/tnodeadlocks.nim +++ b/tests/concurrency/tnodeadlocks.nim @@ -12,7 +12,7 @@ var thr: array [0..5, TThread[tuple[a, b: int]]] L, M, N: TLock -proc doNothing() = nil +proc doNothing() = discard proc threadFunc(interval: tuple[a, b: int]) {.thread.} = doNothing() diff --git a/tests/destructor/tdestructor.nim b/tests/destructor/tdestructor.nim index f10c0cc9c..e5236aaab 100644 --- a/tests/destructor/tdestructor.nim +++ b/tests/destructor/tdestructor.nim @@ -80,13 +80,13 @@ proc mygeneric1() = echo "mygeneric1 constructed" proc mygeneric2[T](val: T) = - var - a = open() - b = TMyGeneric2[int, T](x: 10, y: val) - c = TMyGeneric3[int, int, string](x: 10, y: 20, z: "test") - + var a = open() + + var b = TMyGeneric2[int, T](x: 10, y: val) echo "mygeneric2 constructed" + var c = TMyGeneric3[int, int, string](x: 10, y: 20, z: "test") + proc mygeneric3 = var x = TMyGeneric3[int, string, TMyGeneric1[int]]( x: 10, y: "test", z: TMyGeneric1[int](x: 10)) diff --git a/tests/destructor/tdictdestruct.nim b/tests/destructor/tdictdestruct.nim index ec1084105..b7043f7b7 100644 --- a/tests/destructor/tdictdestruct.nim +++ b/tests/destructor/tdictdestruct.nim @@ -6,7 +6,7 @@ type PDict[TK, TV] = ref TDict[TK, TV] proc fakeNew[T](x: var ref T, destroy: proc (a: ref T) {.nimcall.}) = - nil + discard proc destroyDict[TK, TV](a: PDict[TK, TV]) = return diff --git a/tests/generics/tgeneric3.nim b/tests/generics/tgeneric3.nim index 3c543ecfa..963d0ccfb 100644 --- a/tests/generics/tgeneric3.nim +++ b/tests/generics/tgeneric3.nim @@ -32,7 +32,7 @@ const proc len[T,D] (n:PNode[T,D]): Int {.inline.} = return n.Count -proc clean[T: TOrdinal|TNumber](o: var T) {.inline.} = nil +proc clean[T: TOrdinal|TNumber](o: var T) {.inline.} = discard proc clean[T: string|seq](o: var T) {.inline.} = o = nil @@ -98,7 +98,7 @@ proc DeleteItem[T,D] (n: PNode[T,D], x: Int): PNode[T,D] {.inline.} = of cLen3 : setLen(n.slots, cLen3) of cLenCenter : setLen(n.slots, cLenCenter) of cLen4 : setLen(n.slots, cLen4) - else: nil + else: discard Result = n else : @@ -232,7 +232,7 @@ proc InsertItem[T,D](APath: RPath[T,D], ANode:PNode[T,D], AKey: T, AValue: D) = of cLen3: setLen(APath.Nd.slots, cLenCenter) of cLenCenter: setLen(APath.Nd.slots, cLen4) of cLen4: setLen(APath.Nd.slots, cLenMax) - else: nil + else: discard for i in countdown(APath.Nd.Count.int - 1, x + 1): shallowCopy(APath.Nd.slots[i], APath.Nd.slots[i - 1]) APath.Nd.slots[x] = setItem(AKey, AValue, ANode) diff --git a/tests/generics/tgenericlambda.nim b/tests/generics/tgenericlambda.nim new file mode 100644 index 000000000..f7aafe1d9 --- /dev/null +++ b/tests/generics/tgenericlambda.nim @@ -0,0 +1,18 @@ +discard """ + output: "10\n10\n1\n2\n3" +""" + +proc test(x: proc (a, b: int): int) = + echo x(5, 5) + +test(proc (a, b): auto = a + b) + +test do (a, b) -> auto: a + b + +proc foreach[T](s: seq[T], body: proc(x: T)) = + for e in s: + body(e) + +foreach(@[1,2,3]) do (x): + echo x + diff --git a/tests/generics/tmetafield.nim b/tests/generics/tmetafield.nim new file mode 100644 index 000000000..42353006d --- /dev/null +++ b/tests/generics/tmetafield.nim @@ -0,0 +1,18 @@ +discard """ + cmd: "nimrod check $# $#" + msg: "'proc' is not a concrete type" + msg: "'Foo' is not a concrete type." + msg: "invalid type: 'TBaseMed'" +""" + +type + Foo[T] = object + x: T + + TBaseMed = object + doSmth: proc + data: seq[Foo] + +var a: TBaseMed + +# issue 188 diff --git a/tests/global/globalaux.nim b/tests/global/globalaux.nim new file mode 100644 index 000000000..5f6f72721 --- /dev/null +++ b/tests/global/globalaux.nim @@ -0,0 +1,15 @@ +type + TObj*[T] = object + val*: T + +var + totalGlobals* = 0 + +proc makeObj[T](x: T): TObj[T] = + totalGlobals += 1 + result.val = x + +proc globalInstance*[T]: var TObj[T] = + var g {.global.} = when T is int: makeObj(10) else: makeObj("hello") + result = g + diff --git a/tests/global/globalaux2.nim b/tests/global/globalaux2.nim new file mode 100644 index 000000000..6c77f1f48 --- /dev/null +++ b/tests/global/globalaux2.nim @@ -0,0 +1,4 @@ +import globalaux + +echo "in globalaux2: ", globalInstance[int]().val + diff --git a/tests/lookups/tredef.nim b/tests/lookups/tredef.nim index 02d1f7776..a1647000c 100644 --- a/tests/lookups/tredef.nim +++ b/tests/lookups/tredef.nim @@ -1,28 +1,28 @@ -template foo(a: int, b: string) = nil +template foo(a: int, b: string) = discard foo(1, "test") -proc bar(a: int, b: string) = nil +proc bar(a: int, b: string) = discard bar(1, "test") template foo(a: int, b: string) = bar(a, b) foo(1, "test") block: - proc bar(a: int, b: string) = nil - template foo(a: int, b: string) = nil + proc bar(a: int, b: string) = discard + template foo(a: int, b: string) = discard foo(1, "test") bar(1, "test") proc baz = - proc foo(a: int, b: string) = nil + proc foo(a: int, b: string) = discard proc foo(b: string) = - template bar(a: int, b: string) = nil + template bar(a: int, b: string) = discard bar(1, "test") foo("test") block: - proc foo(b: string) = nil + proc foo(b: string) = discard foo("test") foo(1, "test") diff --git a/tests/macros/tvarnimnode.nim b/tests/macros/tvarnimnode.nim new file mode 100644 index 000000000..73fcc16ea --- /dev/null +++ b/tests/macros/tvarnimnode.nim @@ -0,0 +1,19 @@ +discard """ + output: 10 +""" + +#bug #926 + +import macros + +proc test(f: var PNimrodNode) {.compileTime.} = + f = newNimNode(nnkStmtList) + f.add newCall(newIdentNode("echo"), newLit(10)) + +macro blah(prc: stmt): stmt = + result = prc + + test(result) + +proc test() {.blah.} = + echo 5 diff --git a/tests/manyloc/argument_parser/argument_parser.nim b/tests/manyloc/argument_parser/argument_parser.nim index 95c71c08c..1edda4aa0 100644 --- a/tests/manyloc/argument_parser/argument_parser.nim +++ b/tests/manyloc/argument_parser/argument_parser.nim @@ -178,14 +178,14 @@ template new_parsed_parameter*(tkind: Tparam_kind, expr): Tparsed_parameter = ## #parsed_param3 = new_parsed_parameter(PK_INT, "231") var result {.gensym.}: Tparsed_parameter result.kind = tkind - when tkind == PK_EMPTY: nil + when tkind == PK_EMPTY: discard elif tkind == PK_INT: result.int_val = expr elif tkind == PK_BIGGEST_INT: result.big_int_val = expr elif tkind == PK_FLOAT: result.float_val = expr elif tkind == PK_BIGGEST_FLOAT: result.big_float_val = expr elif tkind == PK_STRING: result.str_val = expr elif tkind == PK_BOOL: result.bool_val = expr - elif tkind == PK_HELP: nil + elif tkind == PK_HELP: discard else: {.error: "unknown kind".} result diff --git a/tests/metatype/tbindtypedesc.nim b/tests/metatype/tbindtypedesc.nim index 5ea8cf063..84527362f 100644 --- a/tests/metatype/tbindtypedesc.nim +++ b/tests/metatype/tbindtypedesc.nim @@ -1,10 +1,10 @@ discard """ - msg: ''' -int -float -TFoo -TFoo -''' + msg: '''int int +float float +int int +TFoo TFoo +int float +TFoo TFoo''' """ import typetraits @@ -24,9 +24,8 @@ template reject(e: expr) = proc genericParamRepeated[T: typedesc](a: T, b: T) = static: - echo a.name - echo b.name - + echo a.name, " ", b.name + accept genericParamRepeated(int, int) accept genericParamRepeated(float, float) @@ -35,8 +34,7 @@ reject genericParamRepeated(int, float) proc genericParamOnce[T: typedesc](a, b: T) = static: - echo a.name - echo b.name + echo a.name, " ", b.name accept genericParamOnce(int, int) accept genericParamOnce(TFoo, TFoo) @@ -68,8 +66,7 @@ reject typePairs2(string, int, TBAR, TBAR) proc dontBind(a: typedesc, b: typedesc) = static: - echo a.name - echo b.name + echo a.name, " ", b.name accept dontBind(int, float) accept dontBind(TFoo, TFoo) diff --git a/tests/metatype/tusertypeclasses.nim b/tests/metatype/tusertypeclasses.nim index 4c8c0fc56..5b04c490f 100644 --- a/tests/metatype/tusertypeclasses.nim +++ b/tests/metatype/tusertypeclasses.nim @@ -31,9 +31,10 @@ proc intval(x: int) = discard # check real and virtual fields type TFoo = generic T - intval T.x + T.x + y(T) intval T.y - + proc y(x: TObj): int = 10 proc testFoo(x: TFoo) = discard diff --git a/tests/method/tmethods1.nim b/tests/method/tmethods1.nim index f4add6af4..43a260bca 100644 --- a/tests/method/tmethods1.nim +++ b/tests/method/tmethods1.nim @@ -14,8 +14,8 @@ type TSomethingElse = object PSomethingElse = ref TSomethingElse -method foo(a: PNode, b: PSomethingElse) = nil -method foo(a: PNodeFoo, b: PSomethingElse) = nil +method foo(a: PNode, b: PSomethingElse) = discard +method foo(a: PNodeFoo, b: PSomethingElse) = discard var o: TObject o.somethin() diff --git a/tests/module/trecinca.nim b/tests/module/trecinca.nim index 73a0ec937..62d37783c 100644 --- a/tests/module/trecinca.nim +++ b/tests/module/trecinca.nim @@ -1,7 +1,7 @@ discard """ file: "tests/reject/trecincb.nim" line: 9 - errormsg: "recursive dependency: 'tests/reject/trecincb.nim'" + errormsg: "recursive dependency: 'tests/module/trecincb.nim'" """ # Test recursive includes diff --git a/tests/module/trecincb.nim b/tests/module/trecincb.nim index 9dd7d51de..a2934052f 100644 --- a/tests/module/trecincb.nim +++ b/tests/module/trecincb.nim @@ -1,7 +1,7 @@ discard """ file: "trecincb.nim" line: 9 - errormsg: "recursive dependency: 'tests/reject/trecincb.nim'" + errormsg: "recursive dependency: 'tests/module/trecincb.nim'" """ # Test recursive includes diff --git a/tests/overload/toverwr.nim b/tests/overload/toverwr.nim index ef25e8913..32d50faaa 100644 --- a/tests/overload/toverwr.nim +++ b/tests/overload/toverwr.nim @@ -1,13 +1,13 @@ -discard """ - file: "toverwr.nim" - output: "hello" -""" +discard """ + file: "toverwr.nim" + output: "hello" +""" # Test the overloading resolution in connection with a qualifier proc write(t: TFile, s: string) = - nil # a nop + discard # a nop system.write(stdout, "hello") #OUT hello - - + + diff --git a/tests/patterns/targlist.nim b/tests/patterns/targlist.nim index a2fa1fa48..e416edf0a 100644 --- a/tests/patterns/targlist.nim +++ b/tests/patterns/targlist.nim @@ -2,7 +2,7 @@ discard """ output: "12false3ha" """ -proc f(x: varargs[string, `$`]) = nil +proc f(x: varargs[string, `$`]) = discard template optF{f(X)}(x: varargs[expr]) = writeln(stdout, x) diff --git a/tests/range/tsubrange2.nim b/tests/range/tsubrange2.nim index 51598713b..d14111bb9 100644 --- a/tests/range/tsubrange2.nim +++ b/tests/range/tsubrange2.nim @@ -8,7 +8,7 @@ type TRange = range[0..40] proc p(r: TRange) = - nil + discard var r: TRange diff --git a/tests/range/tsubrange3.nim b/tests/range/tsubrange3.nim index b3e02fd29..9afb5018b 100644 --- a/tests/range/tsubrange3.nim +++ b/tests/range/tsubrange3.nim @@ -8,7 +8,7 @@ type TRange = range[0..40] proc p(r: TRange) = - nil + discard var r: TRange diff --git a/tests/sets/tsets.nim b/tests/sets/tsets.nim index 7b806f15b..e370209ed 100644 --- a/tests/sets/tsets.nim +++ b/tests/sets/tsets.nim @@ -1,7 +1,7 @@ -discard """ - file: "tsets.nim" - output: "Ha ein F ist in s!" -""" +discard """ + file: "tsets.nim" + output: "Ha ein F ist in s!" +""" # Test the handling of sets import @@ -38,7 +38,7 @@ type TTokTypes* = set[TTokTypeRange] const - toktypes: TTokTypes = {TTokTypeRange(tkSymbol)..pred(tkIntLit), + toktypes: TTokTypes = {TTokTypeRange(tkSymbol)..pred(tkIntLit), tkStrLit..tkTripleStrLit} var @@ -51,14 +51,14 @@ else: write(stdout, "BUG: F ist nicht in s!\n") a = {} #{'a'..'z'} for x in low(TAZ) .. high(TAZ): incl(a, x) - if x in a: nil + if x in a: discard else: write(stdout, "BUG: something not in a!\n") for x in low(TTokTypeRange) .. high(TTokTypeRange): if x in tokTypes: - nil + discard #writeln(stdout, "the token '$1' is in the set" % repr(x)) #OUT Ha ein F ist in s! - - + + diff --git a/tests/stdlib/tircbot.nim b/tests/stdlib/tircbot.nim index 6008838ff..f0417c7ac 100644 --- a/tests/stdlib/tircbot.nim +++ b/tests/stdlib/tircbot.nim @@ -200,7 +200,7 @@ proc setSeen(d: TDb, s: TSeen) = var hashToSet = @[("type", $s.kind.int), ("channel", s.channel), ("timestamp", $s.timestamp.int)] case s.kind - of PSeenJoin: nil + of PSeenJoin: discard of PSeenPart, PSeenMsg, PSeenQuit: hashToSet.add(("msg", s.msg)) of PSeenNick: @@ -338,7 +338,7 @@ proc hubConnect(state: PState) = proc handleIrc(irc: PAsyncIRC, event: TIRCEvent, state: PState) = case event.typ - of EvConnected: nil + of EvConnected: discard of EvDisconnected: while not state.ircClient.isConnected: try: @@ -424,7 +424,7 @@ proc handleIrc(irc: PAsyncIRC, event: TIRCEvent, state: PState) = seenNick.newNick = event.params[0] state.database.setSeen(seenNick) else: - nil # TODO: ? + discard # TODO: ? proc open(port: TPort = TPort(5123)): PState = var res: PState diff --git a/tests/stdlib/tmath2.nim b/tests/stdlib/tmath2.nim index 6a1dae54d..935b08634 100644 --- a/tests/stdlib/tmath2.nim +++ b/tests/stdlib/tmath2.nim @@ -1,7 +1,7 @@ # tests for the interpreter proc loops(a: var int) = - nil + discard #var # b: int #b = glob diff --git a/tests/stdlib/tos.nim b/tests/stdlib/tos.nim index fa9993cc9..ebe577b00 100644 --- a/tests/stdlib/tos.nim +++ b/tests/stdlib/tos.nim @@ -7,6 +7,6 @@ proc walkDirTree(root: string) = case k of pcFile, pcLinkToFile: echo(f) of pcDir: walkDirTree(f) - of pcLinkToDir: nil + of pcLinkToDir: discard walkDirTree(".") diff --git a/tests/stdlib/tpegs.nim b/tests/stdlib/tpegs.nim index bdd8db0f8..7775091a1 100644 --- a/tests/stdlib/tpegs.nim +++ b/tests/stdlib/tpegs.nim @@ -72,7 +72,7 @@ type rule: TNode ## the rule that the symbol refers to TNode {.final, shallow.} = object case kind: TPegKind - of pkEmpty..pkWhitespace: nil + of pkEmpty..pkWhitespace: discard of pkTerminal, pkTerminalIgnoreCase, pkTerminalIgnoreStyle: term: string of pkChar, pkGreedyRepChar: ch: char of pkCharChoice, pkGreedyRepSet: charChoice: ref set[char] @@ -123,7 +123,7 @@ proc add(d: var TPeg, s: TPeg) {.inline.} = add(d.sons, s) proc copyPeg(a: TPeg): TPeg = result.kind = a.kind case a.kind - of pkEmpty..pkWhitespace: nil + of pkEmpty..pkWhitespace: discard of pkTerminal, pkTerminalIgnoreCase, pkTerminalIgnoreStyle: result.term = a.term of pkChar, pkGreedyRepChar: @@ -229,7 +229,7 @@ when false: case a.kind of pkEmpty, pkAny, pkAnyRune, pkGreedyAny, pkNewLine, pkTerminal, pkTerminalIgnoreCase, pkTerminalIgnoreStyle, pkChar, pkGreedyRepChar, - pkCharChoice, pkGreedyRepSet: nil + pkCharChoice, pkGreedyRepSet: discard of pkNonTerminal: return true else: for i in 0..a.sons.len-1: @@ -318,7 +318,7 @@ proc backrefIgnoreStyle*(index: range[1..MaxSubPatterns]): TPeg {. proc spaceCost(n: TPeg): int = case n.kind - of pkEmpty: nil + of pkEmpty: discard of pkTerminal, pkTerminalIgnoreCase, pkTerminalIgnoreStyle, pkChar, pkGreedyRepChar, pkCharChoice, pkGreedyRepSet, pkAny..pkWhitespace, pkGreedyAny: @@ -1111,7 +1111,7 @@ proc handleHexChar(c: var TPegLexer, xi: var int) = of 'A'..'F': xi = (xi shl 4) or (ord(c.buf[c.bufpos]) - ord('A') + 10) inc(c.bufpos) - else: nil + else: discard proc getEscapedChar(c: var TPegLexer, tok: var TToken) = inc(c.bufpos) @@ -1341,7 +1341,7 @@ proc getTok(c: var TPegLexer, tok: var TToken) = of "i": tok.modifier = modIgnoreCase of "y": tok.modifier = modIgnoreStyle of "v": tok.modifier = modVerbatim - else: nil + else: discard setLen(tok.literal, 0) if c.buf[c.bufpos] == '$': getDollar(c, tok) @@ -1488,7 +1488,7 @@ proc primary(p: var TPegParser): TPeg = of tkCurlyAt: getTok(p) return !*\primary(p).token(p) - else: nil + else: discard case p.tok.kind of tkIdentifier: if p.identIsVerbatim: diff --git a/tests/table/ttableconstr.nim b/tests/table/ttableconstr.nim index c627e68e8..1a21a18d1 100644 --- a/tests/table/ttableconstr.nim +++ b/tests/table/ttableconstr.nim @@ -1,7 +1,7 @@ # Test if the new table constructor syntax works: template ignoreExpr(e: expr): stmt {.immediate.} = - nil + discard # test first class '..' syntactical citizen: ignoreExpr x <> 2..4 diff --git a/tests/sunset.tmpl b/tests/template/sunset.tmpl index 6475bac4e..6475bac4e 100644 --- a/tests/sunset.tmpl +++ b/tests/template/sunset.tmpl diff --git a/tests/threads/nimrod.cfg b/tests/threads/nimrod.cfg new file mode 100644 index 000000000..b81c89721 --- /dev/null +++ b/tests/threads/nimrod.cfg @@ -0,0 +1 @@ +threads:on diff --git a/tests/typerel/tvoid.nim b/tests/typerel/tvoid.nim index bb569e7f8..d31936217 100644 --- a/tests/typerel/tvoid.nim +++ b/tests/typerel/tvoid.nim @@ -1,5 +1,9 @@ discard """ - output: "he, no return type;abc a string" + output: '''12 +empty +he, no return type; +abc a string +ha''' """ proc ReturnT[T](x: T): T = diff --git a/tests/typerel/typalias.nim b/tests/typerel/typalias.nim index ba9f38ed9..40ff06765 100644 --- a/tests/typerel/typalias.nim +++ b/tests/typerel/typalias.nim @@ -9,7 +9,7 @@ proc init: TYourObj = result.y = -1 proc f(x: var TYourObj) = - nil + discard var m: TMyObj = init() f(m) |