diff options
264 files changed, 305 insertions, 623 deletions
diff --git a/testament/categories.nim b/testament/categories.nim index 3d7b6a7d7..6ab14a2cf 100644 --- a/testament/categories.nim +++ b/testament/categories.nim @@ -299,17 +299,28 @@ proc testNimInAction(r: var TResults, cat: Category, options: string) = # edit when making a conscious breaking change, also please try to make your # commit message clear and notify me so I can easily compile an errata later. const refHashes = @[ - "51afdfa84b3ca3d810809d6c4e5037ba", "30f07e4cd5eaec981f67868d4e91cfcf", - "d14e7c032de36d219c9548066a97e846", "2e40bfd5daadb268268727da91bb4e81", - "c5d3853ed0aba04bf6d35ba28a98dca0", "058603145ff92d46c009006b06e5b228", - "7b94a029b94ddb7efafddd546c965ff6", "586d74514394e49f2370dfc01dd9e830", - "13febc363ed82585f2a60de40ddfefda", "c11a013db35e798f44077bc0763cc86d", - "3e32e2c5e9a24bd13375e1cd0467079c", "0b9fe7ba159623d49ae60db18a15037c", - "b2dd5293d7f784824bbf9792c6fb51ad", "4c19d8d9026bfe151b31d7007fa3c237", - "9415c6a568cfceed08da8378e95b5cd5", "da520038c153f4054cb8cc5faa617714", - "e6c6e061b6f77b2475db6fec7abfb7f4", "9a8fe78c588d08018843b64b57409a02", - "8b5d28e985c0542163927d253a3e4fc9", "783299b98179cc725f9c46b5e3b5381f", - "bc523f9a9921299090bac1af6c958e73", "80f9c3e594a798225046e8a42e990daf" + "51afdfa84b3ca3d810809d6c4e5037ba", + "30f07e4cd5eaec981f67868d4e91cfcf", + "d14e7c032de36d219c9548066a97e846", + "b335635562ff26ec0301bdd86356ac0c", + "6c4add749fbf50860e2f523f548e6b0e", + "76de5833a7cc46f96b006ce51179aeb1", + "705eff79844e219b47366bd431658961", + "a1e87b881c5eb161553d119be8b52f64", + "13febc363ed82585f2a60de40ddfefda", + "c11a013db35e798f44077bc0763cc86d", + "3e32e2c5e9a24bd13375e1cd0467079c", + "0b9fe7ba159623d49ae60db18a15037c", + "b2dd5293d7f784824bbf9792c6fb51ad", + "4c19d8d9026bfe151b31d7007fa3c237", + "9415c6a568cfceed08da8378e95b5cd5", + "da520038c153f4054cb8cc5faa617714", + "e6c6e061b6f77b2475db6fec7abfb7f4", + "9a8fe78c588d08018843b64b57409a02", + "8b5d28e985c0542163927d253a3e4fc9", + "783299b98179cc725f9c46b5e3b5381f", + "bc523f9a9921299090bac1af6c958e73", + "80f9c3e594a798225046e8a42e990daf", ] for i, test in tests: @@ -317,6 +328,8 @@ proc testNimInAction(r: var TResults, cat: Category, options: string) = let testHash = getMD5(readFile(filename).string) doAssert testHash == refHashes[i], "Nim in Action test " & filename & " was changed." + + # Run the tests. for testfile in tests: test "tests/" & testfile & ".nim" diff --git a/testament/specs.nim b/testament/specs.nim index 3583166fe..6c9fafa13 100644 --- a/testament/specs.nim +++ b/testament/specs.nim @@ -143,10 +143,16 @@ proc parseSpec*(filename: string): TSpec = else: result.parseErrors.addLine "cannot interpret as action: ", e.value of "file": + if result.msg.len == 0 and result.nimout.len == 0: + result.parseErrors.addLine "errormsg or msg needs to be specified before file" result.file = e.value of "line": + if result.msg.len == 0 and result.nimout.len == 0: + result.parseErrors.addLine "errormsg, msg or nimout needs to be specified before line" discard parseInt(e.value, result.line) of "column": + if result.msg.len == 0 and result.nimout.len == 0: + result.parseErrors.addLine "errormsg or msg needs to be specified before column" discard parseInt(e.value, result.column) of "tfile": result.tfile = e.value diff --git a/tests/ambsym/tambsym.nim b/tests/ambsym/tambsym.nim index d9115e16d..bd0f41717 100644 --- a/tests/ambsym/tambsym.nim +++ b/tests/ambsym/tambsym.nim @@ -1,7 +1,7 @@ discard """ + errormsg: "ambiguous identifier" file: "tambsym.nim" line: 11 - errormsg: "ambiguous identifier" """ # Test ambiguous symbols @@ -11,5 +11,3 @@ var v: TExport #ERROR_MSG ambiguous identifier v = y - - diff --git a/tests/ambsym/tambsym2.nim b/tests/ambsym/tambsym2.nim index 8e288e73a..747f1a086 100644 --- a/tests/ambsym/tambsym2.nim +++ b/tests/ambsym/tambsym2.nim @@ -1,5 +1,4 @@ discard """ - file: "tambsym2.nim" output: "7" """ # Test overloading of procs with locals @@ -20,5 +19,3 @@ m.len = 7 m.data = "1234" x(m, 5) #OUT 7 - - diff --git a/tests/ambsym/tambsym3.nim b/tests/ambsym/tambsym3.nim index b25dadfd6..0558517bd 100644 --- a/tests/ambsym/tambsym3.nim +++ b/tests/ambsym/tambsym3.nim @@ -1,7 +1,7 @@ discard """ + errormsg: "ambiguous identifier" file: "tambsym3.nim" line: 11 - errormsg: "ambiguous identifier" """ # Test ambiguous symbols @@ -11,5 +11,3 @@ var v = mDec #ERROR_MSG ambiguous identifier writeLine(stdout, ord(v)) - - diff --git a/tests/ambsym/tambsys.nim b/tests/ambsym/tambsys.nim index 67522d7c9..aa740c38f 100644 --- a/tests/ambsym/tambsys.nim +++ b/tests/ambsym/tambsys.nim @@ -1,5 +1,4 @@ discard """ - file: "tambsys.nim" output: "" """ # Test ambiguous symbols @@ -9,5 +8,3 @@ import mambsys1, mambsys2 var v: mambsys1.TExport mambsys2.foo(3) #OUT - - diff --git a/tests/array/tarray.nim b/tests/array/tarray.nim index 8551d324c..d12808668 100644 --- a/tests/array/tarray.nim +++ b/tests/array/tarray.nim @@ -1,7 +1,5 @@ discard """ - file: "tarray.nim" - output: -''' +output: ''' [4, 5, 6] [16, 25, 36] diff --git a/tests/array/tarraycons.nim b/tests/array/tarraycons.nim index 9f09fd405..b6ebe55c8 100644 --- a/tests/array/tarraycons.nim +++ b/tests/array/tarraycons.nim @@ -1,7 +1,7 @@ discard """ + errormsg: "invalid order in array constructor" file: "tarraycons.nim" line: 14 - errormsg: "invalid order in array constructor" """ type @@ -19,6 +19,3 @@ const ] echo myMapping[eC][1] - - - diff --git a/tests/array/tarraycons_ptr_generic2.nim b/tests/array/tarraycons_ptr_generic2.nim index fce7af669..f6ed32b58 100644 --- a/tests/array/tarraycons_ptr_generic2.nim +++ b/tests/array/tarraycons_ptr_generic2.nim @@ -1,7 +1,7 @@ discard """ + errormsg: "type mismatch: got <ptr Hard[system.string]> but expected 'Book[system.string]'" file: "tarraycons_ptr_generic2.nim" line: 17 - errormsg: "type mismatch: got <ptr Hard[system.string]> but expected 'Book[system.string]'" """ type diff --git a/tests/assert/tassert.nim b/tests/assert/tassert.nim index b5f2fb715..99929f080 100644 --- a/tests/assert/tassert.nim +++ b/tests/assert/tassert.nim @@ -1,5 +1,4 @@ discard """ - file: "tassert.nim" outputsub: "assertion failure!this shall be always written" exitcode: "1" """ @@ -19,5 +18,3 @@ finally: system.write(stdout, "this shall be always written") assert(false) #OUT assertion failure!this shall be always written - - diff --git a/tests/assign/tassign.nim b/tests/assign/tassign.nim index cb03b5004..b421802ae 100644 --- a/tests/assign/tassign.nim +++ b/tests/assign/tassign.nim @@ -1,5 +1,4 @@ discard """ - file: "tassign.nim" output: ''' TEMP=C:\Programs\xyz\bin diff --git a/tests/assign/tvariantasgn.nim b/tests/assign/tvariantasgn.nim index 46cc23dd1..2278957ac 100644 --- a/tests/assign/tvariantasgn.nim +++ b/tests/assign/tvariantasgn.nim @@ -1,7 +1,7 @@ discard """ - file: "tvariantasgn.nim" output: "came here" """ + #BUG type TAnyKind = enum @@ -26,5 +26,3 @@ nr.intVal = 78 # s = nr # works nr = s # fails! echo "came here" - - diff --git a/tests/async/t7758.nim b/tests/async/t7758.nim index 102a4ce4c..ce4df1fc9 100644 --- a/tests/async/t7758.nim +++ b/tests/async/t7758.nim @@ -1,7 +1,3 @@ -discard """ - file: "t7758.nim" - exitcode: 0 -""" import asyncdispatch proc task() {.async.} = @@ -16,4 +12,4 @@ proc main() = doAssert counter <= 4 -for i in 0 .. 10: main() \ No newline at end of file +for i in 0 .. 10: main() diff --git a/tests/async/tasyncRecvLine.nim b/tests/async/tasyncRecvLine.nim index 679831b27..a13a171c3 100644 --- a/tests/async/tasyncRecvLine.nim +++ b/tests/async/tasyncRecvLine.nim @@ -1,6 +1,5 @@ discard """ - file: "tasyncRecvLine.nim" - output: ''' +output: ''' Hello World Hello World ''' diff --git a/tests/async/tasync_gcunsafe.nim b/tests/async/tasync_gcunsafe.nim index f4e2cdcf2..55b66aaef 100644 --- a/tests/async/tasync_gcunsafe.nim +++ b/tests/async/tasync_gcunsafe.nim @@ -1,7 +1,7 @@ discard """ + errormsg: "'anotherGCSafeAsyncProcIter' is not GC-safe as it calls 'asyncGCUnsafeProc'" cmd: "nim c --threads:on $file" file: "asyncmacro.nim" - errormsg: "'anotherGCSafeAsyncProcIter' is not GC-safe as it calls 'asyncGCUnsafeProc'" """ assert compileOption("threads"), "this test will not do anything useful without --threads:on" diff --git a/tests/async/tasyncall.nim b/tests/async/tasyncall.nim index 3e30e8ba8..3c318dbf7 100644 --- a/tests/async/tasyncall.nim +++ b/tests/async/tasyncall.nim @@ -1,5 +1,4 @@ discard """ - file: "tasyncall.nim" exitcode: 0 """ import times, sequtils diff --git a/tests/async/tasyncawait.nim b/tests/async/tasyncawait.nim index e7a2ec1d9..fcb48a1f5 100644 --- a/tests/async/tasyncawait.nim +++ b/tests/async/tasyncawait.nim @@ -1,5 +1,4 @@ discard """ - file: "tasyncawait.nim" output: "5000" """ import asyncdispatch, nativesockets, net, strutils, os diff --git a/tests/async/tasyncconnect.nim b/tests/async/tasyncconnect.nim index 3dac379b2..f63a87990 100644 --- a/tests/async/tasyncconnect.nim +++ b/tests/async/tasyncconnect.nim @@ -1,7 +1,6 @@ discard """ - file: "tasyncconnect.nim" - exitcode: 1 outputsub: "Error: unhandled exception: Connection refused" + exitcode: 1 """ import diff --git a/tests/async/tasyncdial.nim b/tests/async/tasyncdial.nim index fa81235fe..815520294 100644 --- a/tests/async/tasyncdial.nim +++ b/tests/async/tasyncdial.nim @@ -1,5 +1,4 @@ discard """ - file: "tasyncdial.nim" output: ''' OK AF_INET OK AF_INET6 diff --git a/tests/async/tasyncexceptions.nim b/tests/async/tasyncexceptions.nim index 7aa1d7fb0..3a34478ca 100644 --- a/tests/async/tasyncexceptions.nim +++ b/tests/async/tasyncexceptions.nim @@ -1,7 +1,6 @@ discard """ - file: "tasyncexceptions.nim" - exitcode: 1 outputsub: "Error: unhandled exception: foobar" + exitcode: 1 """ import asyncdispatch diff --git a/tests/async/tasyncfile.nim b/tests/async/tasyncfile.nim index c7b71a2f7..3043b680a 100644 --- a/tests/async/tasyncfile.nim +++ b/tests/async/tasyncfile.nim @@ -1,10 +1,9 @@ discard """ - output: '''13 +output: ''' +13 hello humans! 13 ''' - file: "tasyncfile.nim" - exitcode: 0 """ import asyncfile, asyncdispatch, os diff --git a/tests/async/tasyncrecursion.nim b/tests/async/tasyncrecursion.nim index 1aeebe9b4..c038be640 100644 --- a/tests/async/tasyncrecursion.nim +++ b/tests/async/tasyncrecursion.nim @@ -1,6 +1,5 @@ discard """ - file: "tasyncrecursion.nim" - output: "50005000" +output: "50005000" """ import asyncdispatch diff --git a/tests/async/tasyncsend4757.nim b/tests/async/tasyncsend4757.nim index 752bb3e75..a87c5df95 100644 --- a/tests/async/tasyncsend4757.nim +++ b/tests/async/tasyncsend4757.nim @@ -1,6 +1,5 @@ discard """ - file: "tasyncsend4754.nim" - output: "Finished" +output: "Finished" """ import asyncdispatch, asyncnet diff --git a/tests/async/tasyncssl.nim b/tests/async/tasyncssl.nim index 212260922..88a5eb32e 100644 --- a/tests/async/tasyncssl.nim +++ b/tests/async/tasyncssl.nim @@ -1,5 +1,4 @@ discard """ - file: "tasyncssl.nim" cmd: "nim $target --hints:on --define:ssl $options $file" output: "500" disabled: "windows" diff --git a/tests/async/tasynctry.nim b/tests/async/tasynctry.nim index 0fe9efdc1..b13c57951 100644 --- a/tests/async/tasynctry.nim +++ b/tests/async/tasynctry.nim @@ -1,7 +1,5 @@ discard """ - file: "tasynctry.nim" - exitcode: 0 - output: ''' +output: ''' Generic except: Test Specific except Multiple idents in except diff --git a/tests/async/tawaitsemantics.nim b/tests/async/tawaitsemantics.nim index 98fb5dfd5..67903cc5e 100644 --- a/tests/async/tawaitsemantics.nim +++ b/tests/async/tawaitsemantics.nim @@ -1,7 +1,5 @@ discard """ - file: "tawaitsemantics.nim" - exitcode: 0 - output: ''' +output: ''' Error can be caught using yield Infix `or` raises Infix `and` raises diff --git a/tests/async/tfuturestream.nim b/tests/async/tfuturestream.nim index 69ad80f47..b5772d5ac 100644 --- a/tests/async/tfuturestream.nim +++ b/tests/async/tfuturestream.nim @@ -1,7 +1,5 @@ discard """ - file: "tfuturestream.nim" - exitcode: 0 - output: ''' +output: ''' 0 1 2 @@ -70,4 +68,4 @@ waitFor testCompletion() # echo("Finished") -# waitFor omega() \ No newline at end of file +# waitFor omega() diff --git a/tests/async/tioselectors.nim b/tests/async/tioselectors.nim index 7a8986644..be6d3a167 100644 --- a/tests/async/tioselectors.nim +++ b/tests/async/tioselectors.nim @@ -1,5 +1,4 @@ discard """ - file: "tioselectors.nim" output: "All tests passed!" """ import selectors diff --git a/tests/async/tnewasyncudp.nim b/tests/async/tnewasyncudp.nim index b442c0524..7dbd5a3d0 100644 --- a/tests/async/tnewasyncudp.nim +++ b/tests/async/tnewasyncudp.nim @@ -1,5 +1,4 @@ discard """ - file: "tnewasyncudp.nim" output: "5000" """ import asyncdispatch, nativesockets, net, strutils, os diff --git a/tests/async/tpendingcheck.nim b/tests/async/tpendingcheck.nim index 825acb613..a5537d8cb 100644 --- a/tests/async/tpendingcheck.nim +++ b/tests/async/tpendingcheck.nim @@ -1,6 +1,4 @@ discard """ - file: "tpendingcheck.nim" - exitcode: 0 output: "" """ @@ -18,4 +16,3 @@ while not f.finished: f.read doAssert(not hasPendingOperations()) - diff --git a/tests/async/twinasyncrw.nim b/tests/async/twinasyncrw.nim index 94193e921..64c5d6c26 100644 --- a/tests/async/twinasyncrw.nim +++ b/tests/async/twinasyncrw.nim @@ -1,5 +1,4 @@ discard """ - file: "twinasyncrw.nim" output: "5000" """ when defined(windows): diff --git a/tests/bind/tbind.nim b/tests/bind/tbind.nim index 6fcf95433..49c37ae2e 100644 --- a/tests/bind/tbind.nim +++ b/tests/bind/tbind.nim @@ -1,7 +1,5 @@ discard """ - file: "tbind.nim" - output: -''' +output: ''' 3 1 1 diff --git a/tests/bind/tbind2.nim b/tests/bind/tbind2.nim index 799b14381..fc2eeda1a 100644 --- a/tests/bind/tbind2.nim +++ b/tests/bind/tbind2.nim @@ -1,7 +1,7 @@ discard """ + errormsg: "ambiguous call" file: "tbind2.nim" line: 12 - errormsg: "ambiguous call" """ # Test the new ``bind`` keyword for templates @@ -12,6 +12,3 @@ template tempBind(x, y): untyped = (bind p1(x, y)) #ERROR_MSG ambiguous call echo tempBind(1'i8, 2'i8) - - - diff --git a/tests/bind/tinvalidbindtypedesc.nim b/tests/bind/tinvalidbindtypedesc.nim index ecdd12603..4bcd4e39d 100644 --- a/tests/bind/tinvalidbindtypedesc.nim +++ b/tests/bind/tinvalidbindtypedesc.nim @@ -1,6 +1,6 @@ discard """ - line: 10 errormsg: "type mismatch: got <type float, string>" + line: 10 """ proc foo(T: typedesc; some: T) = @@ -8,4 +8,3 @@ proc foo(T: typedesc; some: T) = foo int, 4 foo float, "bad" - diff --git a/tests/bind/tnicerrorforsymchoice.nim b/tests/bind/tnicerrorforsymchoice.nim index 8c3a99c97..f16b323de 100644 --- a/tests/bind/tnicerrorforsymchoice.nim +++ b/tests/bind/tnicerrorforsymchoice.nim @@ -1,6 +1,6 @@ discard """ - line: 18 errormsg: "type mismatch: got <proc (s: TScgi: ScgiState or AsyncScgiState) | proc (client: AsyncSocket, headers: StringTableRef, input: string){.noSideEffect, gcsafe, locks: 0.}>" + line: 18 """ #bug #442 diff --git a/tests/borrow/tinvalidborrow.nim b/tests/borrow/tinvalidborrow.nim index 9ab9e8d64..89aa4e2e8 100644 --- a/tests/borrow/tinvalidborrow.nim +++ b/tests/borrow/tinvalidborrow.nim @@ -1,6 +1,6 @@ discard """ - line: 11 errormsg: "no symbol to borrow from found" + line: 11 """ # bug #516 @@ -14,4 +14,3 @@ var d, e: TAtom echo( $(d == e) ) - diff --git a/tests/casestmt/t7699.nim b/tests/casestmt/t7699.nim index ea08388eb..1354551c1 100644 --- a/tests/casestmt/t7699.nim +++ b/tests/casestmt/t7699.nim @@ -1,6 +1,6 @@ discard """ - line: 13 errormsg: "case statement cannot work on enums with holes for computed goto" + line: 13 """ type diff --git a/tests/casestmt/tcaseexpr1.nim b/tests/casestmt/tcaseexpr1.nim index 24543f1b8..4fdac8191 100644 --- a/tests/casestmt/tcaseexpr1.nim +++ b/tests/casestmt/tcaseexpr1.nim @@ -1,13 +1,17 @@ discard """ - file: "tcaseexpr1.nim" - - line: 29 errormsg: "type mismatch: got <string> but expected 'int'" + line: 33 + file: "tcaseexpr1.nim" - line: 23 errormsg: "not all cases are covered" + line: 27 + file: "tcaseexpr1.nim" """ +# NOTE: This spec is wrong. Spec doesn't support multiple error +# messages. The first one is simply overridden by the second one. +# This just has never been noticed. + type E = enum A, B, C @@ -27,4 +31,3 @@ var t1 = case x: var t2 = case x: of A: 10 of B, C: "23" - diff --git a/tests/casestmt/tcaseoverlaprange.nim b/tests/casestmt/tcaseoverlaprange.nim index 3527c9385..e9651c69f 100644 --- a/tests/casestmt/tcaseoverlaprange.nim +++ b/tests/casestmt/tcaseoverlaprange.nim @@ -1,6 +1,6 @@ discard """ - line: 13 errormsg: "duplicate case label" + line: 13 """ type diff --git a/tests/casestmt/tcaseoverlaprange2.nim b/tests/casestmt/tcaseoverlaprange2.nim index 4a9479a5f..4a1cb3ea6 100644 --- a/tests/casestmt/tcaseoverlaprange2.nim +++ b/tests/casestmt/tcaseoverlaprange2.nim @@ -1,6 +1,6 @@ discard """ - line: 13 errormsg: "duplicate case label" + line: 13 """ diff --git a/tests/casestmt/tcasestmt.nim b/tests/casestmt/tcasestmt.nim index 333700197..465080e84 100644 --- a/tests/casestmt/tcasestmt.nim +++ b/tests/casestmt/tcasestmt.nim @@ -1,6 +1,5 @@ discard """ - file: "tcasestmt.nim" - output: +output: ''' Not found! Found! @@ -226,4 +225,4 @@ block tcasestm: "invalid Y".quit(3) true else: raise newException(ValueError, "Invalid") - )) \ No newline at end of file + )) diff --git a/tests/ccgbugs/tcgbug.nim b/tests/ccgbugs/tcgbug.nim index ffaa91ff3..eda475d4f 100644 --- a/tests/ccgbugs/tcgbug.nim +++ b/tests/ccgbugs/tcgbug.nim @@ -1,6 +1,6 @@ discard """ - file: "tcgbug.nim" - output: '''success +output: ''' +success M1 M2 ''' """ @@ -74,5 +74,5 @@ proc newMyObjectRef(kind: MyKind, val: string): MyObjectRef = of M2: result.b = parseFloat(val) of M3: result.c = val - -echo newMyObject(M1, "2").kind, " ", newMyObjectRef(M2, "3").kind \ No newline at end of file + +echo newMyObject(M1, "2").kind, " ", newMyObjectRef(M2, "3").kind diff --git a/tests/clearmsg/tconsttypemismatch.nim b/tests/clearmsg/tconsttypemismatch.nim index edf480348..727bfbffb 100644 --- a/tests/clearmsg/tconsttypemismatch.nim +++ b/tests/clearmsg/tconsttypemismatch.nim @@ -1,8 +1,7 @@ discard """ + errormsg: "type mismatch" file: "tconsttypemismatch.nim" line: 7 - errormsg: "type mismatch" """ # bug #2252 const foo: int = 1000 / 30 - diff --git a/tests/clearmsg/tmacroerrorproc.nim b/tests/clearmsg/tmacroerrorproc.nim index cd9b15e25..86726af72 100644 --- a/tests/clearmsg/tmacroerrorproc.nim +++ b/tests/clearmsg/tmacroerrorproc.nim @@ -1,7 +1,7 @@ discard """ + errormsg: "Expected a node of kind nnkCharLit, got nnkCommand" file: "tmacroerrorproc.nim" line: 13 - errormsg: "Expected a node of kind nnkCharLit, got nnkCommand" """ # issue #4915 import macros diff --git a/tests/closure/tinvalidclosure.nim b/tests/closure/tinvalidclosure.nim index 4e5f61f06..b2d8bd28d 100644 --- a/tests/closure/tinvalidclosure.nim +++ b/tests/closure/tinvalidclosure.nim @@ -1,6 +1,6 @@ discard """ - line: 12 errormsg: "type mismatch: got <proc (x: int){.gcsafe, locks: 0.}>" + line: 12 """ proc ugh[T](x: T) {.nimcall.} = diff --git a/tests/closure/tinvalidclosure2.nim b/tests/closure/tinvalidclosure2.nim index 845559309..2d58f0215 100644 --- a/tests/closure/tinvalidclosure2.nim +++ b/tests/closure/tinvalidclosure2.nim @@ -1,6 +1,6 @@ discard """ - line: 10 errormsg: "illegal capture 'A'" + line: 10 """ proc outer() = diff --git a/tests/closure/tinvalidclosure3.nim b/tests/closure/tinvalidclosure3.nim index 31c4976f8..0cbdaf39e 100644 --- a/tests/closure/tinvalidclosure3.nim +++ b/tests/closure/tinvalidclosure3.nim @@ -1,6 +1,6 @@ discard """ - line: 9 errormsg: "illegal capture 'x'" + line: 9 """ proc outer(arg: string) = @@ -9,4 +9,4 @@ proc outer(arg: string) = echo "inner", x inner() -outer("abc") \ No newline at end of file +outer("abc") diff --git a/tests/closure/tnested.nim b/tests/closure/tnested.nim index f8d69011a..dbbe9ba58 100644 --- a/tests/closure/tnested.nim +++ b/tests/closure/tnested.nim @@ -1,6 +1,5 @@ discard """ - file: "tnested.nim" - output: ''' +output: ''' foo88 23 24foo 88 foo88 diff --git a/tests/cnstseq/tcnstseq.nim b/tests/cnstseq/tcnstseq.nim index e044b9f3f..5679a6e37 100644 --- a/tests/cnstseq/tcnstseq.nim +++ b/tests/cnstseq/tcnstseq.nim @@ -1,6 +1,5 @@ discard """ - file: "tcnstseq.nim" - output: ''' +output: ''' AngelikaAnneAnnaAnkaAnja AngelikaAnneAnnaAnkaAnja AngelikaAnneAnnaAnkaAnja diff --git a/tests/collections/tcollections.nim b/tests/collections/tcollections.nim index ff6673bba..2f8cfece7 100644 --- a/tests/collections/tcollections.nim +++ b/tests/collections/tcollections.nim @@ -1,7 +1,5 @@ discard """ - file: "tcollections.nim" - output: ''' -''' + output: "" """ import deques, sequtils diff --git a/tests/collections/ttables.nim b/tests/collections/ttables.nim index 4d11f56f2..f1355e747 100644 --- a/tests/collections/ttables.nim +++ b/tests/collections/ttables.nim @@ -1,6 +1,5 @@ discard """ - file: "ttables.nim" - output: ''' +output: ''' done And we get here 1 @@ -142,7 +141,7 @@ block tindexby: tbl2.add("bar", elem1) tbl2.add("baz", elem2) doAssert indexBy(@[elem1,elem2], proc(x: TElem): string = x.bar) == tbl2, "element table" - + block tableconstr: # Test if the new table constructor syntax works: diff --git a/tests/concepts/tconcepts.nim b/tests/concepts/tconcepts.nim index dec1dafe0..d0bc76c20 100644 --- a/tests/concepts/tconcepts.nim +++ b/tests/concepts/tconcepts.nim @@ -1,6 +1,5 @@ discard """ - file: "tconcepts.nim" - output: ''' +output: ''' 10 20 int @@ -378,53 +377,53 @@ block tvectorspace: block tstack: template reject(e) = static: assert(not compiles(e)) - + type ArrayStack = object data: seq[int] - + proc push(s: var ArrayStack, item: int) = s.data.add item - + proc pop(s: var ArrayStack): int = return s.data.pop() - + type Stack[T] = concept var s s.push(T) s.pop() is T - + type ValueType = T const ValueTypeName = T.name.toUpperAscii - + proc genericAlgorithm[T](s: var Stack[T], y: T) = static: echo "INFERRED ", T.name echo "VALUE TYPE ", s.ValueType.name echo "VALUE TYPE NAME ", s.ValueTypeName - + s.push(y) echo s.pop - + proc implicitGeneric(s: var Stack): auto = static: echo "IMPLICIT INFERRED ", s.T.name, " ", Stack.T.name echo "IMPLICIT VALUE TYPE ", s.ValueType.name, " ", Stack.ValueType.name echo "IMPLICIT VALUE TYPE NAME ", s.ValueTypeName, " ", Stack.ValueTypeName - + return s.pop() - + var s = ArrayStack(data: @[]) - + s.push 10 s.genericAlgorithm 20 echo s.implicitGeneric - + reject s.genericAlgorithm "x" reject s.genericAlgorithm 1.0 reject "str".implicitGeneric reject implicitGeneric(10) - + import libs/[trie_database, trie] diff --git a/tests/concepts/texplain.nim b/tests/concepts/texplain.nim index 5c8e02440..ac0c972f5 100644 --- a/tests/concepts/texplain.nim +++ b/tests/concepts/texplain.nim @@ -63,8 +63,8 @@ texplain.nim(92, 5) NestedConcept: concept predicate failed expression: f(y) ''' - line: 138 errormsg: "type mismatch: got <MatchingType>" + line: 138 """ @@ -136,4 +136,3 @@ static: # finally, provide multiple nested explanations for failed matching # of regular concepts, even when the explain pragma is not used f(y) - diff --git a/tests/constr/tconstr1.nim b/tests/constr/tconstr1.nim index b9cf5d00b..a169bf453 100644 --- a/tests/constr/tconstr1.nim +++ b/tests/constr/tconstr1.nim @@ -1,7 +1,7 @@ discard """ + errormsg: "type mismatch" file: "tconstr1.nim" line: 25 - errormsg: "type mismatch" """ # Test array, record constructors @@ -26,5 +26,3 @@ const otherThings = [ # the same (s: "hi", x: 69, y: 45, z: 0.0, chars: {'a', 'b', 'c'}), (s: "hi", x: 69, y: 45, z: 1.0, chars: {'a'})] - - diff --git a/tests/constr/tconstr2.nim b/tests/constr/tconstr2.nim index b16be6c50..b911de548 100644 --- a/tests/constr/tconstr2.nim +++ b/tests/constr/tconstr2.nim @@ -1,5 +1,4 @@ discard """ - file: "tconstr2.nim" output: "69" """ # Test array, record constructors @@ -21,6 +20,3 @@ const write(stdout, things[0].x) #OUT 69 - - - diff --git a/tests/constraints/tconstraints.nim b/tests/constraints/tconstraints.nim index 3c9fdc354..3ca01cfd5 100644 --- a/tests/constraints/tconstraints.nim +++ b/tests/constraints/tconstraints.nim @@ -1,6 +1,6 @@ discard """ - line: 16 errormsg: "type mismatch: got <int literal(232)>" + line: 16 """ proc myGenericProc[T: object|tuple|ptr|ref|distinct](x: T): string = @@ -14,5 +14,3 @@ var assert myGenericProc(x) == "(x: 0, y: 0)" assert myGenericProc(232) == "232" - - diff --git a/tests/constructors/t5965_1.nim b/tests/constructors/t5965_1.nim index 9f947f859..abf07b21c 100644 --- a/tests/constructors/t5965_1.nim +++ b/tests/constructors/t5965_1.nim @@ -1,7 +1,7 @@ discard """ + errormsg: "incorrect object construction syntax" file: "t5965_1.nim" line: 10 - errormsg: "incorrect object construction syntax" """ type Foo = object diff --git a/tests/constructors/t5965_2.nim b/tests/constructors/t5965_2.nim index a3f7174c9..e04f1b715 100644 --- a/tests/constructors/t5965_2.nim +++ b/tests/constructors/t5965_2.nim @@ -1,7 +1,7 @@ discard """ + errormsg: "incorrect object construction syntax" file: "t5965_2.nim" line: 10 - errormsg: "incorrect object construction syntax" """ type Foo = object diff --git a/tests/controlflow/tblock1.nim b/tests/controlflow/tblock1.nim index e3a780dfe..70c844513 100644 --- a/tests/controlflow/tblock1.nim +++ b/tests/controlflow/tblock1.nim @@ -1,7 +1,7 @@ discard """ + errormsg: "undeclared identifier: \'ha\'" file: "tblock1.nim" line: 14 - errormsg: "undeclared identifier: \'ha\'" """ # check for forward label and # for failure when label is not declared @@ -14,5 +14,3 @@ proc main = break ha #ERROR main() - - diff --git a/tests/controlflow/tstatret.nim b/tests/controlflow/tstatret.nim index 8f43c5d8f..e0f816c7d 100644 --- a/tests/controlflow/tstatret.nim +++ b/tests/controlflow/tstatret.nim @@ -1,12 +1,9 @@ discard """ + errormsg: "unreachable statement after 'return' statement or '{.noReturn.}' proc" file: "tstatret.nim" line: 9 - errormsg: "unreachable statement after 'return' statement or '{.noReturn.}' proc" """ # no statement after return proc main() = return echo("huch?") #ERROR_MSG statement not allowed after - - - diff --git a/tests/converter/tconverter_unique_ptr.nim b/tests/converter/tconverter_unique_ptr.nim index 25b001d52..23c1a3d96 100644 --- a/tests/converter/tconverter_unique_ptr.nim +++ b/tests/converter/tconverter_unique_ptr.nim @@ -1,6 +1,5 @@ discard """ - file: "tconverter_unique_ptr.nim" targets: "c cpp" output: "" """ @@ -34,7 +33,7 @@ proc `=`*(m: var MySeq, m2: MySeq) = `=destroy`(m) m.len = m2.len - let bytes = m.len.int * sizeof(float) + let bytes = m.len.int * sizeof(float) if bytes > 0: m.data = cast[ptr UncheckedArray[float]](allocShared(bytes)) copyMem(m.data, m2.data, bytes) @@ -59,7 +58,7 @@ proc `[]`*(m: var MySeq; i: MyLen): var float {.inline.} = proc `[]=`*(m: var MySeq; i: MyLen, val: float) {.inline.} = m.data[i.int] = val -proc setTo(s: var MySeq, val: float) = +proc setTo(s: var MySeq, val: float) = for i in 0..<s.len.int: s.data[i] = val @@ -112,7 +111,7 @@ doAssert pu[0] == 2.0 doAssert: pu2[0] == 2.0 ##----------------------------------------------------------------------------------------- -## Bugs #9735 and #9736 +## Bugs #9735 and #9736 type ConstPtr*[T] = object ## This pointer makes it impossible to change underlying value diff --git a/tests/converter/tconverter_with_constraint.nim b/tests/converter/tconverter_with_constraint.nim index 793264434..ce5135586 100644 --- a/tests/converter/tconverter_with_constraint.nim +++ b/tests/converter/tconverter_with_constraint.nim @@ -1,8 +1,8 @@ discard """ + errormsg: "type mismatch: got <int>" file: "tconverter_with_constraint.nim" line: 20 - errormsg: "type mismatch: got <int>" """ type @@ -10,11 +10,11 @@ type converter to_mytype(m: int{lit}): MyType = m.MyType - + proc myproc(m: MyType) = echo m.int, ".MyType" -myproc(1) # call by literal is ok +myproc(1) # call by literal is ok var x: int = 12 -myproc(x) # should fail \ No newline at end of file +myproc(x) # should fail diff --git a/tests/deprecated/tnoannot.nim b/tests/deprecated/tnoannot.nim index 9cc5c7e06..ac168952e 100644 --- a/tests/deprecated/tnoannot.nim +++ b/tests/deprecated/tnoannot.nim @@ -1,6 +1,6 @@ discard """ - line: 7 errormsg: "annotation to deprecated not supported here" + line: 7 """ var foo* {.deprecated.} = 42 diff --git a/tests/discard/tillegaldiscard.nim b/tests/discard/tillegaldiscard.nim index 5e1a3f03e..757f4e727 100644 --- a/tests/discard/tillegaldiscard.nim +++ b/tests/discard/tillegaldiscard.nim @@ -1,6 +1,6 @@ discard """ - line: 9 errormsg: "illegal discard" + line: 9 """ proc pop[T](arg: T): T = diff --git a/tests/discard/tneedsdiscard.nim b/tests/discard/tneedsdiscard.nim index 8d59e7fec..7d2997b3f 100644 --- a/tests/discard/tneedsdiscard.nim +++ b/tests/discard/tneedsdiscard.nim @@ -1,6 +1,6 @@ discard """ - line: 10 errormsg: '''expression 'open(f, "arg.txt", fmRead, -1)' is of type 'bool' and has to be discarded; start of expression here: tneedsdiscard.nim(7, 2)''' + line: 10 """ proc p = diff --git a/tests/discard/tneedsdiscard_in_for.nim b/tests/discard/tneedsdiscard_in_for.nim index 5658f4ba2..499b06009 100644 --- a/tests/discard/tneedsdiscard_in_for.nim +++ b/tests/discard/tneedsdiscard_in_for.nim @@ -1,6 +1,6 @@ discard """ - line: 22 errormsg: '''expression 'premultiply(app.gradient[i])' is of type 'Rgba8' and has to be discarded''' + line: 22 """ # bug #9076 diff --git a/tests/distinct/tnil.nim b/tests/distinct/tnil.nim index 16de38f60..5bdb97f37 100644 --- a/tests/distinct/tnil.nim +++ b/tests/distinct/tnil.nim @@ -1,6 +1,6 @@ discard """ - file: "tnil.nim" - output: '''1 +output: ''' +1 0 0 ''' diff --git a/tests/effects/teffects1.nim b/tests/effects/teffects1.nim index ef76c9130..767845cb4 100644 --- a/tests/effects/teffects1.nim +++ b/tests/effects/teffects1.nim @@ -1,6 +1,6 @@ discard """ - file: "system.nim" errormsg: "can raise an unlisted exception: ref IOError" + file: "system.nim" """ type @@ -17,4 +17,3 @@ proc lier(): int {.raises: [IO2Error].} = proc forw: int = raise newException(IOError, "arg") - diff --git a/tests/effects/teffects2.nim b/tests/effects/teffects2.nim index 0fa789869..e4b50aba5 100644 --- a/tests/effects/teffects2.nim +++ b/tests/effects/teffects2.nim @@ -1,6 +1,6 @@ discard """ - line: 19 errormsg: "can raise an unlisted exception: ref IOError" + line: 19 """ type @@ -17,4 +17,3 @@ proc lier(): int {.raises: [IOError].} = proc forw: int = raise newException(IOError, "arg") - diff --git a/tests/effects/teffects3.nim b/tests/effects/teffects3.nim index cbd11f722..ee5470c47 100644 --- a/tests/effects/teffects3.nim +++ b/tests/effects/teffects3.nim @@ -1,6 +1,6 @@ discard """ - line: 18 errormsg: "type mismatch" + line: 18 """ type @@ -16,4 +16,3 @@ proc raiser(): int {.tags: [TObj, WriteIoEffect].} = var o: TObjB o.fn = raiser - diff --git a/tests/effects/teffects4.nim b/tests/effects/teffects4.nim index 0025c10c5..88cc0efa9 100644 --- a/tests/effects/teffects4.nim +++ b/tests/effects/teffects4.nim @@ -1,6 +1,6 @@ discard """ - line: 23 errormsg: "type mismatch" + line: 23 """ type @@ -21,4 +21,3 @@ proc raiser(): int = var o: TObjB o.fn = raiser - diff --git a/tests/effects/tgcsafe.nim b/tests/effects/tgcsafe.nim index d146794b6..ff207df59 100644 --- a/tests/effects/tgcsafe.nim +++ b/tests/effects/tgcsafe.nim @@ -1,6 +1,6 @@ discard """ - line: 17 errormsg: "'mainUnsafe' is not GC-safe" + line: 17 cmd: "nim $target --hints:on --threads:on $options $file" """ diff --git a/tests/effects/tsidee1.nim b/tests/effects/tsidee1.nim index e486d32e7..ca6816561 100644 --- a/tests/effects/tsidee1.nim +++ b/tests/effects/tsidee1.nim @@ -1,7 +1,7 @@ discard """ + errormsg: "\'SideEffectLyer\' can have side effects" file: "tsidee1.nim" line: 12 - errormsg: "\'SideEffectLyer\' can have side effects" """ var @@ -13,6 +13,3 @@ proc SideEffectLyer(x, y: int): int {.noSideEffect.} = #ERROR_MSG 'SideEffectLye return x + y + dontcare(x) echo SideEffectLyer(1, 3) - - - diff --git a/tests/effects/tsidee2.nim b/tests/effects/tsidee2.nim index 5ed541300..b2e5f3379 100644 --- a/tests/effects/tsidee2.nim +++ b/tests/effects/tsidee2.nim @@ -1,5 +1,4 @@ discard """ - file: "tsidee2.nim" output: "5" """ @@ -12,6 +11,3 @@ proc SideEffectLyer(x, y: int): int {.noSideEffect.} = return x + y + dontcare(x) echo SideEffectLyer(1, 3) #OUT 5 - - - diff --git a/tests/effects/tsidee3.nim b/tests/effects/tsidee3.nim index e15fbc3d1..c3801ba28 100644 --- a/tests/effects/tsidee3.nim +++ b/tests/effects/tsidee3.nim @@ -1,5 +1,4 @@ discard """ - file: "tsidee3.nim" output: "5" """ @@ -12,6 +11,3 @@ proc noSideEffect(x, y: int, p: proc (a: int): int {.noSideEffect.}): int {.noSi return x + y + dontcare(x) echo noSideEffect(1, 3, dontcare) #OUT 5 - - - diff --git a/tests/effects/tsidee4.nim b/tests/effects/tsidee4.nim index ecc79580c..d6c192cbf 100644 --- a/tests/effects/tsidee4.nim +++ b/tests/effects/tsidee4.nim @@ -1,7 +1,7 @@ discard """ + errormsg: "'noSideEffect' can have side effects" file: "tsidee4.nim" line: 12 - errormsg: "'noSideEffect' can have side effects" """ var @@ -13,5 +13,3 @@ proc noSideEffect(x, y: int, p: proc (a: int): int {.noSideEffect.}): int {.noSi return x + y + dontcare(x) echo noSideEffect(1, 3, dontcare) #ERROR_MSG type mismatch - - diff --git a/tests/enum/tenumitems.nim b/tests/enum/tenumitems.nim index 6d13dd162..76f368f8a 100644 --- a/tests/enum/tenumitems.nim +++ b/tests/enum/tenumitems.nim @@ -1,9 +1,7 @@ discard """ - line: 7 errormsg: "attempting to call routine: 'items'" + line: 7 """ type a = enum b,c,d a.items() - - diff --git a/tests/errmsgs/t8339.nim b/tests/errmsgs/t8339.nim index f0a97658a..720e080c0 100644 --- a/tests/errmsgs/t8339.nim +++ b/tests/errmsgs/t8339.nim @@ -1,6 +1,6 @@ discard """ - line: 8 errormsg: "type mismatch: got <seq[int]> but expected 'seq[float]'" + line: 8 """ import sequtils diff --git a/tests/exception/tcontinuexc.nim b/tests/exception/tcontinuexc.nim index 2a05da9c0..b7560a605 100644 --- a/tests/exception/tcontinuexc.nim +++ b/tests/exception/tcontinuexc.nim @@ -1,5 +1,4 @@ discard """ - file: "tcontinuexc.nim" outputsub: "ECcaught" exitcode: "1" """ @@ -25,6 +24,3 @@ finally: echo "caught" #OUT ECcaught - - - diff --git a/tests/exception/texceptionbreak.nim b/tests/exception/texceptionbreak.nim index 00dd8ed9f..6548192c6 100644 --- a/tests/exception/texceptionbreak.nim +++ b/tests/exception/texceptionbreak.nim @@ -1,5 +1,4 @@ discard """ - file: "tnestedbreak.nim" output: "1\n2\n3\n4" """ diff --git a/tests/exception/texcsub.nim b/tests/exception/texcsub.nim index 02125d2c0..463e95613 100644 --- a/tests/exception/texcsub.nim +++ b/tests/exception/texcsub.nim @@ -1,5 +1,4 @@ discard """ - file: "texcsub.nim" output: "caught!" """ # Test inheritance for exception matching: @@ -12,6 +11,3 @@ except: echo "wtf!?" #OUT caught! - - - diff --git a/tests/exception/tfinally.nim b/tests/exception/tfinally.nim index 7a218b444..c5b1dd841 100644 --- a/tests/exception/tfinally.nim +++ b/tests/exception/tfinally.nim @@ -1,6 +1,6 @@ discard """ - file: "tfinally.nim" - output: '''came + output: ''' +came here 3 msg1 @@ -59,4 +59,4 @@ try: except: echo "except2" finally: - echo "finally2" \ No newline at end of file + echo "finally2" diff --git a/tests/exception/tfinally2.nim b/tests/exception/tfinally2.nim index f1acf2774..dae1a468a 100644 --- a/tests/exception/tfinally2.nim +++ b/tests/exception/tfinally2.nim @@ -1,9 +1,10 @@ discard """ - file: "tfinally2.nim" - output: '''A +output: ''' +A B C -D''' +D +''' """ # Test break in try statement: @@ -24,7 +25,4 @@ proc main: int = finally: echo("D") -discard main() #OUT ABCD - - - +discard main() diff --git a/tests/exception/tfinally3.nim b/tests/exception/tfinally3.nim index 6098672a2..9053d397d 100644 --- a/tests/exception/tfinally3.nim +++ b/tests/exception/tfinally3.nim @@ -1,7 +1,8 @@ discard """ - file: "tfinally3.nim" - outputsub: '''false -Within finally->try''' + outputsub: ''' +false +Within finally->try +''' exitCode: 1 """ # Test break in try statement: diff --git a/tests/exception/tfinally4.nim b/tests/exception/tfinally4.nim index 3aa707ff6..feaf1bc96 100644 --- a/tests/exception/tfinally4.nim +++ b/tests/exception/tfinally4.nim @@ -1,5 +1,4 @@ discard """ - file: "tfinally4.nim" output: "B1\nA1\n1\nB1\nB2\ncatch\nA1\n1\nB1\nA1\nA2\n2\nB1\nB2\ncatch\nA1\nA2\n0\nB1\nA1\n1\nB1\nB2\nA1\n1\nB1\nA1\nA2\n2\nB1\nB2\nA1\nA2\n3" """ diff --git a/tests/exception/tnestedreturn.nim b/tests/exception/tnestedreturn.nim index bf26f4903..acb83d2c8 100644 --- a/tests/exception/tnestedreturn.nim +++ b/tests/exception/tnestedreturn.nim @@ -1,6 +1,5 @@ discard """ targets: "c cpp" - file: "tnestedreturn.nim" output: "A\nB\nC\n" """ diff --git a/tests/exception/tnestedreturn2.nim b/tests/exception/tnestedreturn2.nim index 79523a883..167d09b96 100644 --- a/tests/exception/tnestedreturn2.nim +++ b/tests/exception/tnestedreturn2.nim @@ -1,5 +1,4 @@ discard """ - file: "tnestedreturn2.nim" outputsub: "Error: unhandled exception: Problem [OSError]" exitcode: "1" """ diff --git a/tests/exception/treraise.nim b/tests/exception/treraise.nim index b2a11d34f..17a38aa53 100644 --- a/tests/exception/treraise.nim +++ b/tests/exception/treraise.nim @@ -1,5 +1,4 @@ discard """ - file: "treraise.nim" outputsub: "Error: unhandled exception: bla [ESomeOtherErr]" exitcode: "1" """ @@ -19,6 +18,3 @@ except ESomething: echo("Error happened") except: raise - - - diff --git a/tests/exception/tunhandledexc.nim b/tests/exception/tunhandledexc.nim index f0fa2bf27..6ca311d38 100644 --- a/tests/exception/tunhandledexc.nim +++ b/tests/exception/tunhandledexc.nim @@ -1,7 +1,6 @@ discard """ - file: "tunhandledexc.nim" cmd: "nim $target -d:release $options $file" - outputsub: '''tunhandledexc.nim(16) genErrors + outputsub: '''tunhandledexc.nim(15) genErrors Error: unhandled exception: bla [ESomeOtherErr]''' exitcode: "1" """ diff --git a/tests/exception/twrongexc.nim b/tests/exception/twrongexc.nim index b224d4c83..9c656f3d9 100644 --- a/tests/exception/twrongexc.nim +++ b/tests/exception/twrongexc.nim @@ -1,5 +1,4 @@ discard """ - file: "twrongexc.nim" outputsub: "Error: unhandled exception: [ValueError]" exitcode: "1" """ @@ -7,7 +6,3 @@ try: raise newException(ValueError, "") except OverflowError: echo("Error caught") - - - - diff --git a/tests/exprs/texprstmt.nim b/tests/exprs/texprstmt.nim index 6c9759cf5..742670cc1 100644 --- a/tests/exprs/texprstmt.nim +++ b/tests/exprs/texprstmt.nim @@ -1,6 +1,6 @@ discard """ - line: 10 errormsg: "expression 'result[1 .. BackwardsIndex(1)]' is of type 'string' and has to be discarded" + line: 10 """ # bug #578 diff --git a/tests/exprs/tstmtexp.nim b/tests/exprs/tstmtexp.nim index 0fb835bc6..75d8dd081 100644 --- a/tests/exprs/tstmtexp.nim +++ b/tests/exprs/tstmtexp.nim @@ -1,9 +1,8 @@ discard """ + errormsg: "expression '5' is of type 'int literal(5)' and has to be discarded" file: "tstmtexp.nim" line: 8 - errormsg: "expression '5' is of type 'int literal(5)' and has to be discarded" """ # Test 3 1+4 - diff --git a/tests/flags/tgenscript.nim b/tests/flags/tgenscript.nim index 989ca8bcb..bf83ab972 100644 --- a/tests/flags/tgenscript.nim +++ b/tests/flags/tgenscript.nim @@ -1,5 +1,4 @@ discard """ - file: "tgenscript.nim" target: "c" action: compile """ diff --git a/tests/float/tfloat1.nim b/tests/float/tfloat1.nim index ed99260ea..54d49a7c1 100644 --- a/tests/float/tfloat1.nim +++ b/tests/float/tfloat1.nim @@ -1,5 +1,4 @@ discard """ - file: "tfloat1.nim" outputsub: "Error: unhandled exception: FPU operation caused an overflow [FloatOverflowError]" exitcode: "1" """ @@ -11,5 +10,3 @@ var x = 0.8 var y = 0.0 echo x / y #OUT Error: unhandled exception: FPU operation caused an overflow - - diff --git a/tests/float/tfloat2.nim b/tests/float/tfloat2.nim index b84120fba..130c71087 100644 --- a/tests/float/tfloat2.nim +++ b/tests/float/tfloat2.nim @@ -1,5 +1,4 @@ discard """ - file: "tfloat2.nim" outputsub: "Error: unhandled exception: FPU operation caused a NaN result [FloatInvalidOpError]" exitcode: "1" """ @@ -11,5 +10,3 @@ var x = 0.0 var y = 0.0 echo x / y #OUT Error: unhandled exception: FPU operation caused a NaN result - - diff --git a/tests/float/tfloat3.nim b/tests/float/tfloat3.nim index a14c6c396..01f3cb9df 100644 --- a/tests/float/tfloat3.nim +++ b/tests/float/tfloat3.nim @@ -1,5 +1,4 @@ discard """ - file: "tfloat3.nim" output: "Nim 3.4368930843, 0.3299290698 C double: 3.4368930843, 0.3299290698" """ @@ -19,6 +18,3 @@ proc printFloats {.importc, nodecl.} var x: float = 1.234567890123456789 c_printf("Nim %.10f, %.10f ", exp(x), cos(x)) printFloats() - - - diff --git a/tests/float/tfloat4.nim b/tests/float/tfloat4.nim index 68df56be8..56280111c 100644 --- a/tests/float/tfloat4.nim +++ b/tests/float/tfloat4.nim @@ -1,8 +1,7 @@ discard """ - file: "tfloat4.nim" output: "passed all tests." - exitcode: 0 """ + import math, strutils proc c_sprintf(buf, fmt: cstring) {.importc:"sprintf", header: "<stdio.h>", varargs.} diff --git a/tests/float/tfloat5.nim b/tests/float/tfloat5.nim index aa7dc6c53..0708838fc 100644 --- a/tests/float/tfloat5.nim +++ b/tests/float/tfloat5.nim @@ -1,9 +1,10 @@ discard """ - file: "tfloat5.nim" - output: '''0 : 0.0 +output: ''' 0 : 0.0 0 : 0.0 -0 : 0.0''' +0 : 0.0 +0 : 0.0 +''' """ import parseutils diff --git a/tests/float/tfloat6.nim b/tests/float/tfloat6.nim index 8e043a658..c4cd6e932 100644 --- a/tests/float/tfloat6.nim +++ b/tests/float/tfloat6.nim @@ -1,12 +1,13 @@ discard """ - file: "tfloat6.nim" - output: '''1e-06 : 1e-06 + output: ''' +1e-06 : 1e-06 1e-06 : 1e-06 0.001 : 0.001 1e-06 : 1e-06 1e-06 : 1e-06 10.000001 : 10.000001 -100.000001 : 100.000001''' +100.000001 : 100.000001 +''' disabled: "windows" """ diff --git a/tests/float/tfloat7.nim b/tests/float/tfloat7.nim index 5fd0d43d9..a6d7af10b 100644 --- a/tests/float/tfloat7.nim +++ b/tests/float/tfloat7.nim @@ -1,12 +1,13 @@ discard """ - file: "tfloat6.nim" - output: '''passed. +output: ''' passed. passed. passed. passed. passed. -passed.''' +passed. +passed. +''' """ import strutils diff --git a/tests/float/tfloatnan.nim b/tests/float/tfloatnan.nim index aa288d342..29937a862 100644 --- a/tests/float/tfloatnan.nim +++ b/tests/float/tfloatnan.nim @@ -1,6 +1,6 @@ discard """ - file: "tfloatnan.nim" - output: '''Nim: nan +output: ''' +Nim: nan Nim: nan (float) Nim: nan (double) ''' diff --git a/tests/float/tissue5821.nim b/tests/float/tissue5821.nim index e8aa4a1d9..c4f561f09 100644 --- a/tests/float/tissue5821.nim +++ b/tests/float/tissue5821.nim @@ -1,7 +1,7 @@ discard """ - file: "tissue5821.nim" - output: '''''' +output: "ok" """ + proc main(): void = let a: float32 = 47.11'f32 doAssert a == 47.11'f32 @@ -10,4 +10,6 @@ proc main(): void = doAssert b != 10.123402823e+38'f64 doAssert b == 10.234402823e+38'f64 -main() \ No newline at end of file + echo "ok" + +main() diff --git a/tests/generics/t6137.nim b/tests/generics/t6137.nim index 639675f35..abf02a756 100644 --- a/tests/generics/t6137.nim +++ b/tests/generics/t6137.nim @@ -1,7 +1,6 @@ discard """ - action: "reject" - line: 29 errormsg: "\'vectFunc\' doesn't have a concrete type, due to unspecified generic parameters." + line: 28 """ type diff --git a/tests/generics/t7141.nim b/tests/generics/t7141.nim index 8a128d828..b1e9cbf43 100644 --- a/tests/generics/t7141.nim +++ b/tests/generics/t7141.nim @@ -1,7 +1,6 @@ discard """ - action: "reject" - line: 7 errormsg: "cannot instantiate: \'T\'" + line: 6 """ proc foo[T](x: T) = diff --git a/tests/generics/t8270.nim b/tests/generics/t8270.nim index 707e981fa..1e731d1d4 100644 --- a/tests/generics/t8270.nim +++ b/tests/generics/t8270.nim @@ -1,6 +1,6 @@ discard """ - line: 6 errormsg: "cannot instantiate: \'T\'" + line: 6 """ proc m[T](x: T): int = discard diff --git a/tests/generics/tbintre2.nim b/tests/generics/tbintre2.nim index eb46b5157..4f63cc5f5 100644 --- a/tests/generics/tbintre2.nim +++ b/tests/generics/tbintre2.nim @@ -1,5 +1,4 @@ discard """ - file: "tbintre2.nim" output: "helloworld99110223" """ # Same test, but check module boundaries @@ -26,6 +25,3 @@ for y in items(r2): stdout.write(y) #OUT helloworld99110223 - - - diff --git a/tests/generics/tbintree.nim b/tests/generics/tbintree.nim index 13163f764..b4507e298 100644 --- a/tests/generics/tbintree.nim +++ b/tests/generics/tbintree.nim @@ -1,5 +1,4 @@ discard """ - file: "tbintree.nim" output: "helloworld99110223" """ type @@ -103,5 +102,3 @@ when isMainModule: stdout.write(y) #OUT helloworld99110223 - - diff --git a/tests/generics/texplicitgeneric1.nim b/tests/generics/texplicitgeneric1.nim index ac0197c1a..f093e54d4 100644 --- a/tests/generics/texplicitgeneric1.nim +++ b/tests/generics/texplicitgeneric1.nim @@ -1,5 +1,4 @@ discard """ - file: "texplicitgeneric1.nim" output: "Key: 12 value: 12Key: 13 value: 13 Key: A value: 12 Key: B value: 13" """ # test explicit type instantiation @@ -33,6 +32,3 @@ c.add('A', "12") c.add('B', "13") for k, v in items(c): stdout.write(" Key: ", $k, " value: ", v) - - - diff --git a/tests/global/t5958.nim b/tests/global/t5958.nim index 5abcad4a9..9b7642363 100644 --- a/tests/global/t5958.nim +++ b/tests/global/t5958.nim @@ -1,6 +1,6 @@ discard """ - line: 9 errormsg: "undeclared identifier: 'a'" + line: 9 """ static: diff --git a/tests/iter/tcountup.nim b/tests/iter/tcountup.nim index 1559041aa..83d800c82 100644 --- a/tests/iter/tcountup.nim +++ b/tests/iter/tcountup.nim @@ -1,5 +1,4 @@ discard """ - file: "tcountup.nim" output: "0123456789" """ @@ -9,6 +8,3 @@ for i in 0 .. < 10'i64: stdout.write(i) #OUT 0123456789 - - - diff --git a/tests/iter/titer11.nim b/tests/iter/titer11.nim index 6c410e945..c4c7d4a16 100644 --- a/tests/iter/titer11.nim +++ b/tests/iter/titer11.nim @@ -1,6 +1,6 @@ discard """ - file: "titer11.nim" - output: '''[ +output: ''' +[ 1 2 3 diff --git a/tests/iter/titer3.nim b/tests/iter/titer3.nim index cc603fd85..9dcfd7be5 100644 --- a/tests/iter/titer3.nim +++ b/tests/iter/titer3.nim @@ -1,5 +1,4 @@ discard """ - file: "titer3.nim" output: '''1231 4 6 diff --git a/tests/iter/titer4.nim b/tests/iter/titer4.nim index 9b52f8055..912883a63 100644 --- a/tests/iter/titer4.nim +++ b/tests/iter/titer4.nim @@ -1,10 +1,8 @@ discard """ + errormsg: "iterator within for loop context expected" file: "titer4.nim" line: 7 - errormsg: "iterator within for loop context expected" """ # implicit items/pairs, but not if we have 3 for loop vars: for x, y, z in {'a'..'z'}: #ERROR_MSG iterator within for loop context expected nil - - diff --git a/tests/iter/titer5.nim b/tests/iter/titer5.nim index bbd50fcb1..3c508dca7 100644 --- a/tests/iter/titer5.nim +++ b/tests/iter/titer5.nim @@ -1,5 +1,4 @@ discard """ - file: "titer5.nim" output: "abcxyz" """ # Test method call syntax for iterators: @@ -11,6 +10,3 @@ for x in lines.split(): stdout.write(x) #OUT abcxyz - - - diff --git a/tests/iter/titer6.nim b/tests/iter/titer6.nim index b7c8fee80..b8c2f7c66 100644 --- a/tests/iter/titer6.nim +++ b/tests/iter/titer6.nim @@ -1,5 +1,4 @@ discard """ - file: "titer6.nim" output: "000" """ # Test iterator with more than 1 yield statement @@ -32,6 +31,3 @@ proc wordWrap2(s: string, maxLineWidth = 80, result = "" for word, isSep in tokenize2(s, seps): var w = 0 - - - diff --git a/tests/iter/titervaropenarray.nim b/tests/iter/titervaropenarray.nim index 9eea085e3..b9aa2cbca 100644 --- a/tests/iter/titervaropenarray.nim +++ b/tests/iter/titervaropenarray.nim @@ -1,5 +1,4 @@ discard """ - file: "titer2.nim" output: "123" """ # Try to break the transformation pass: diff --git a/tests/iter/treciter.nim b/tests/iter/treciter.nim index dacdbdfd7..7b61326f4 100644 --- a/tests/iter/treciter.nim +++ b/tests/iter/treciter.nim @@ -1,7 +1,7 @@ discard """ + errormsg: "recursive dependency: \'myrec\'" file: "treciter.nim" line: 9 - errormsg: "recursive dependency: \'myrec\'" """ # Test that an error message occurs for a recursive iterator @@ -10,5 +10,3 @@ iterator myrec(n: int): int = yield x for x in myrec(10): echo x - - diff --git a/tests/iter/twrongiter.nim b/tests/iter/twrongiter.nim index 33394219b..577b8c4f1 100644 --- a/tests/iter/twrongiter.nim +++ b/tests/iter/twrongiter.nim @@ -1,6 +1,6 @@ discard """ -line: 12 errormsg: "type mismatch" +line: 12 """ proc first(it: iterator(): int): seq[int] = diff --git a/tests/let/tlet.nim b/tests/let/tlet.nim index 6703ba254..25d7b9bf7 100644 --- a/tests/let/tlet.nim +++ b/tests/let/tlet.nim @@ -1,6 +1,6 @@ discard """ - line: "10" errormsg: "'name' cannot be assigned to" + line: "10" """ echo("What's your name? ") @@ -8,4 +8,3 @@ let name = readLine(stdin) while name == "": echo("Please tell me your name: ") name = readLine(stdin) - diff --git a/tests/let/tlet2.nim b/tests/let/tlet2.nim index 2df15fa5c..63e7d6128 100644 --- a/tests/let/tlet2.nim +++ b/tests/let/tlet2.nim @@ -1,6 +1,6 @@ discard """ - line: "13" errormsg: "type mismatch: got <int literal(8), int literal(5), int, int>" + line: "13" """ proc divmod(a, b: int, res, remainder: var int) = @@ -13,4 +13,3 @@ let divmod(8, 5, x, y) # modifies x and y echo(x) echo(y) - diff --git a/tests/lexer/tind1.nim b/tests/lexer/tind1.nim index ffbde48fd..2185c3074 100644 --- a/tests/lexer/tind1.nim +++ b/tests/lexer/tind1.nim @@ -1,6 +1,6 @@ discard """ - line: 24 errormsg: "invalid indentation" + line: 24 """ import macros diff --git a/tests/lexer/tinvalidintegerliteral1.nim b/tests/lexer/tinvalidintegerliteral1.nim index 08ab82a22..6bf7624f3 100644 --- a/tests/lexer/tinvalidintegerliteral1.nim +++ b/tests/lexer/tinvalidintegerliteral1.nim @@ -1,7 +1,7 @@ discard """ + errormsg: "invalid number" file: "tinvalidintegerliteral1.nim" line: 7 - errormsg: "invalid number" """ echo 0b diff --git a/tests/lexer/tinvalidintegerliteral2.nim b/tests/lexer/tinvalidintegerliteral2.nim index bc8793e4e..eb6efc131 100644 --- a/tests/lexer/tinvalidintegerliteral2.nim +++ b/tests/lexer/tinvalidintegerliteral2.nim @@ -1,7 +1,7 @@ discard """ + errormsg: "invalid number" file: "tinvalidintegerliteral2.nim" line: 7 - errormsg: "invalid number" """ echo 0x diff --git a/tests/lexer/tinvalidintegerliteral3.nim b/tests/lexer/tinvalidintegerliteral3.nim index 9c2fe69df..e09cda54a 100644 --- a/tests/lexer/tinvalidintegerliteral3.nim +++ b/tests/lexer/tinvalidintegerliteral3.nim @@ -1,7 +1,7 @@ discard """ + errormsg: "0O5 is an invalid int literal; For octal literals use the '0o' prefix." file: "tinvalidintegerliteral3.nim" line: 7 - errormsg: "0O5 is an invalid int literal; For octal literals use the '0o' prefix." """ echo 0O5 diff --git a/tests/lexer/tmissingnl.nim b/tests/lexer/tmissingnl.nim index 095d9570e..dc939bcd2 100644 --- a/tests/lexer/tmissingnl.nim +++ b/tests/lexer/tmissingnl.nim @@ -1,10 +1,9 @@ discard """ + errormsg: "invalid indentation" file: "tmissingnl.nim" line: 7 - errormsg: "invalid indentation" """ import strutils let s: seq[int] = @[0, 1, 2, 3, 4, 5, 6] #s[1..3] = @[] - diff --git a/tests/lexer/tstrlits.nim b/tests/lexer/tstrlits.nim index d13baf7ff..004ebc0a7 100644 --- a/tests/lexer/tstrlits.nim +++ b/tests/lexer/tstrlits.nim @@ -1,5 +1,4 @@ discard """ - file: "tstrlits.nim" output: "a\"\"long string\"\"\"\"\"abc\"def_'2'●𝌆𝌆A" """ # Test the new different string literals @@ -19,6 +18,3 @@ stdout.write(tripleEmpty) stdout.write(raw) stdout.write(escaped) #OUT a""long string"""""abc"def_'2'●𝌆𝌆A - - - diff --git a/tests/lexer/tunderscores.nim b/tests/lexer/tunderscores.nim index f64f36977..1896a2898 100644 --- a/tests/lexer/tunderscores.nim +++ b/tests/lexer/tunderscores.nim @@ -1,7 +1,7 @@ discard """ + errormsg: "invalid token: trailing underscore" file: "tunderscores.nim" line: 8 - errormsg: "invalid token: trailing underscore" """ # Bug #502670 @@ -9,6 +9,3 @@ var ef_ = 3 #ERROR_MSG invalid token: _ var a__b = 1 var c___d = 2 echo(ab, cd, ef_) - - - diff --git a/tests/macros/tmacrogenerics.nim b/tests/macros/tmacrogenerics.nim index e4acdc321..bb562cacb 100644 --- a/tests/macros/tmacrogenerics.nim +++ b/tests/macros/tmacrogenerics.nim @@ -1,5 +1,4 @@ discard """ - file: "tmacrogenerics.nim" nimout: ''' instantiation 1 with None and None instantiation 2 with None and None diff --git a/tests/macros/tquotewords.nim b/tests/macros/tquotewords.nim index fa00ba9de..e718d25f9 100644 --- a/tests/macros/tquotewords.nim +++ b/tests/macros/tquotewords.nim @@ -1,5 +1,4 @@ discard """ - file: "tquotewords.nim" output: "thisanexample" """ # Test an idea I recently had: diff --git a/tests/macros/trecmacro.nim b/tests/macros/trecmacro.nim index 69ebe3da3..d804178bc 100644 --- a/tests/macros/trecmacro.nim +++ b/tests/macros/trecmacro.nim @@ -1,7 +1,7 @@ discard """ + errormsg: "recursive dependency: 'dump'" file: "trecmacro.nim" line: 8 - errormsg: "recursive dependency: 'dump'" """ macro dump(n: untyped): untyped = diff --git a/tests/macros/tstringinterp.nim b/tests/macros/tstringinterp.nim index 305f40ac5..8b8e1c3a9 100644 --- a/tests/macros/tstringinterp.nim +++ b/tests/macros/tstringinterp.nim @@ -1,5 +1,4 @@ discard """ - file: "tstringinterp.nim" output: "Hello Alice, 64 | Hello Bob, 10$" """ diff --git a/tests/metatype/tmatrix.nim b/tests/metatype/tmatrix.nim index 4fd32a932..076009eb9 100644 --- a/tests/metatype/tmatrix.nim +++ b/tests/metatype/tmatrix.nim @@ -1,5 +1,4 @@ discard """ - file: "tmatrix.nim" output: "111" """ # Test overloading of [] with multiple indices @@ -44,5 +43,3 @@ for i in 0..w-1: for i in 0..w-1: stdout.write(m[i,i]) #OUT 111 - - diff --git a/tests/metatype/tstaticparams.nim b/tests/metatype/tstaticparams.nim index ad6aa6589..09d505f94 100644 --- a/tests/metatype/tstaticparams.nim +++ b/tests/metatype/tstaticparams.nim @@ -1,5 +1,4 @@ discard """ - file: "tstaticparams.nim" output: "abracadabra\ntest\n3\n15\n4\n2\nfloat\n3\nfloat\nyin\nyang\n2\n4\n4\n2\n3" """ @@ -140,7 +139,7 @@ dontBind1 bb_2 dontBind2 bb_1 dontBind2 bb_2 -# https://github.com/nim-lang/Nim/issues/4524 +# https://github.com/nim-lang/Nim/issues/4524 const size* = 2 @@ -172,4 +171,3 @@ echo inSize([ [1, 2, 3], [4, 5, 6] ]) - diff --git a/tests/method/tmethod.nim b/tests/method/tmethod.nim index 0cfe24c70..005294d64 100644 --- a/tests/method/tmethod.nim +++ b/tests/method/tmethod.nim @@ -1,7 +1,7 @@ discard """ + errormsg: "\'method\' needs a parameter that has an object type" file: "tmethod.nim" line: 7 - errormsg: "\'method\' needs a parameter that has an object type" """ method m(i: int): int = diff --git a/tests/misc/t99bott.nim b/tests/misc/t99bott.nim index 62ccfbe16..f60023818 100644 --- a/tests/misc/t99bott.nim +++ b/tests/misc/t99bott.nim @@ -1,9 +1,9 @@ discard """ + errormsg: "cannot evaluate at compile time: bn" file: "t99bott.nim" line: 26 - errormsg: "cannot evaluate at compile time: bn" - disabled: false """ + ## 99 Bottles of Beer ## http://www.99-bottles-of-beer.net/ ## Nim version @@ -30,7 +30,3 @@ for bn in countdown(99, 1): echo "No more bottles of beer on the wall, no more bottles of beer." echo "Go to the store and buy some more, 99 bottles of beer on the wall." - - - - diff --git a/tests/misc/tack.nim b/tests/misc/tack.nim index a0afab9e8..fb89dc8b1 100644 --- a/tests/misc/tack.nim +++ b/tests/misc/tack.nim @@ -1,5 +1,4 @@ discard """ - file: "tack.nim" output: "125" """ # the Ackermann function @@ -17,5 +16,3 @@ proc ack(x, y: int): int = # echo(ack(0, 0)) write(stdout, ack(3, 4)) #OUT 125 - - diff --git a/tests/misc/tbug511622.nim b/tests/misc/tbug511622.nim index a5360423d..4b30e96e6 100644 --- a/tests/misc/tbug511622.nim +++ b/tests/misc/tbug511622.nim @@ -1,5 +1,4 @@ discard """ - file: "tbug511622.nim" output: "3" """ import StrUtils, Math @@ -11,6 +10,3 @@ proc FibonacciA(n: int): int64 = return int64((pow(p, fn) + pow(q, fn)) / sqrt(5.0)) echo FibonacciA(4) #OUT 3 - - - diff --git a/tests/misc/temit.nim b/tests/misc/temit.nim index c83235659..ee7455d4c 100644 --- a/tests/misc/temit.nim +++ b/tests/misc/temit.nim @@ -1,5 +1,4 @@ discard """ - file: "temit.nim" output: "509" """ # Test the new ``emit`` pragma: @@ -14,7 +13,3 @@ proc embedsC() = {.emit: """printf("%d\n", cvariable + (int)`nimVar`);""".} embedsC() - - - - diff --git a/tests/misc/tevents.nim b/tests/misc/tevents.nim index caf674084..045c9fc5b 100644 --- a/tests/misc/tevents.nim +++ b/tests/misc/tevents.nim @@ -1,8 +1,9 @@ discard """ -file: "tevents.nim" -output: '''HandlePrintEvent: Output -> Handled print event +output: ''' +HandlePrintEvent: Output -> Handled print event HandlePrintEvent2: Output -> printing for ME -HandlePrintEvent2: Output -> printing for ME''' +HandlePrintEvent2: Output -> printing for ME +''' """ import events @@ -45,4 +46,3 @@ ee.emit(obj.printEvent, eventargs) obj.printEvent.removeHandler(handleprintevent2) ee.emit(obj.printEvent, eventargs) - diff --git a/tests/misc/tgenconstraints.nim b/tests/misc/tgenconstraints.nim index 6e8fdc738..829da5173 100644 --- a/tests/misc/tgenconstraints.nim +++ b/tests/misc/tgenconstraints.nim @@ -1,8 +1,8 @@ discard """ + errormsg: "cannot instantiate T2" file: "tgenconstraints.nim" line: 25 disabled: true - errormsg: "cannot instantiate T2" """ type @@ -29,4 +29,3 @@ proc bar(x: int|TNumber): T1[type(x)] {.discardable.} = bar "test" bar 100 bar 1.1 - diff --git a/tests/misc/thintoff.nim b/tests/misc/thintoff.nim deleted file mode 100644 index 95318ce9b..000000000 --- a/tests/misc/thintoff.nim +++ /dev/null @@ -1,12 +0,0 @@ -discard """ - file: "thintoff.nim" - output: "0" -""" - -{.hint[XDeclaredButNotUsed]: off.} -var - x: int - -echo x #OUT 0 - - diff --git a/tests/misc/tinc.nim b/tests/misc/tinc.nim index 7819775e3..91f6223e2 100644 --- a/tests/misc/tinc.nim +++ b/tests/misc/tinc.nim @@ -1,12 +1,8 @@ discard """ + errormsg: "type mismatch: got <int>" file: "tinc.nim" line: 8 - errormsg: "type mismatch: got <int>" """ var x = 0 inc(x+1) - - - - diff --git a/tests/misc/tinit.nim b/tests/misc/tinit.nim index 02607909b..207cb17e8 100644 --- a/tests/misc/tinit.nim +++ b/tests/misc/tinit.nim @@ -1,5 +1,4 @@ discard """ - file: "tinit.nim" output: "Hello from module! Hello from main module!" """ # Test the new init section in modules @@ -8,5 +7,3 @@ import minit write(stdout, "Hello from main module!\n") #OUT Hello from module! Hello from main module! - - diff --git a/tests/misc/tinout.nim b/tests/misc/tinout.nim index 46af2f5de..bae0fb185 100644 --- a/tests/misc/tinout.nim +++ b/tests/misc/tinout.nim @@ -1,7 +1,7 @@ discard """ + errormsg: "type mismatch: got <int literal(3)>" file: "tinout.nim" line: 12 - errormsg: "type mismatch: got <int literal(3)>" """ # Test in out checking for parameters @@ -12,5 +12,3 @@ proc b() = abc(3) #ERROR b() - - diff --git a/tests/misc/tinvalidnewseq.nim b/tests/misc/tinvalidnewseq.nim index 66e9388ef..dec00fd4a 100644 --- a/tests/misc/tinvalidnewseq.nim +++ b/tests/misc/tinvalidnewseq.nim @@ -1,7 +1,7 @@ discard """ + errormsg: "type mismatch: got <array[0..6, string], int literal(7)>" file: "tinvalidnewseq.nim" line: 15 - errormsg: "type mismatch: got <array[0..6, string], int literal(7)>" """ import re, strutils @@ -22,6 +22,3 @@ var r: TUrl r = parseUrl(r"http://google.com/search?var=bleahdhsad") echo(r.domain) - - - diff --git a/tests/misc/tissue710.nim b/tests/misc/tissue710.nim index e2cca0024..ec125b840 100644 --- a/tests/misc/tissue710.nim +++ b/tests/misc/tissue710.nim @@ -1,7 +1,7 @@ discard """ + errorMsg: "attempting to call routine: '||'" file: "tissue710.nim" line: 8 - errorMsg: "attempting to call routine: '||'" """ var sum = 0 for x in 3..1000: diff --git a/tests/misc/tnoinst.nim b/tests/misc/tnoinst.nim index 25ebe8dfc..85db1e8e7 100644 --- a/tests/misc/tnoinst.nim +++ b/tests/misc/tnoinst.nim @@ -1,6 +1,6 @@ discard """ - line: 12 errormsg: "instantiate 'notConcrete' explicitly" + line: 12 disabled: "true" """ @@ -14,4 +14,3 @@ proc wrap[T]() = wrap[int]() - diff --git a/tests/misc/tnolen.nim b/tests/misc/tnolen.nim index 2831e5048..e0e8025d4 100644 --- a/tests/misc/tnolen.nim +++ b/tests/misc/tnolen.nim @@ -1,9 +1,8 @@ discard """ - line: 8 errormsg: "type mismatch: got <int literal(3)>" + line: 8 """ # please finally disallow Len(3) echo len(3) - diff --git a/tests/misc/tnot.nim b/tests/misc/tnot.nim index 5c268981e..a3669705b 100644 --- a/tests/misc/tnot.nim +++ b/tests/misc/tnot.nim @@ -1,7 +1,7 @@ discard """ + errormsg: "type mismatch" file: "tnot.nim" line: 14 - errormsg: "type mismatch" """ # BUG: following compiles, but should not: diff --git a/tests/misc/tparseopt.nim b/tests/misc/tparseopt.nim index 651689398..cbed5d476 100644 --- a/tests/misc/tparseopt.nim +++ b/tests/misc/tparseopt.nim @@ -1,5 +1,4 @@ discard """ - file: "tparseopt.nim" output: ''' parseopt first round diff --git a/tests/misc/tpos.nim b/tests/misc/tpos.nim index bedb62e62..0c8efa43d 100644 --- a/tests/misc/tpos.nim +++ b/tests/misc/tpos.nim @@ -1,5 +1,4 @@ discard """ - file: "tpos.nim" output: "6" """ # test this particular function @@ -31,5 +30,3 @@ var sub = "hello" var s = "world hello" write(stdout, mypos(sub, s)) #OUT 6 - - diff --git a/tests/misc/trawstr.nim b/tests/misc/trawstr.nim index 55e508acc..aa41071d5 100644 --- a/tests/misc/trawstr.nim +++ b/tests/misc/trawstr.nim @@ -1,12 +1,10 @@ discard """ + errormsg: "closing \" expected" file: "trawstr.nim" line: 10 - errormsg: "closing \" expected" """ # Test the new raw strings: const xxx = r"This is a raw string!" yyy = "This not\" #ERROR - - diff --git a/tests/misc/tsimtych.nim b/tests/misc/tsimtych.nim index 037172bd5..74a6ad4c0 100644 --- a/tests/misc/tsimtych.nim +++ b/tests/misc/tsimtych.nim @@ -1,12 +1,10 @@ discard """ + errormsg: "type mismatch: got <bool> but expected \'string\'" file: "tsimtych.nim" line: 10 - errormsg: "type mismatch: got <bool> but expected \'string\'" """ # Test 2 # Simple type checking var a: string a = false #ERROR - - diff --git a/tests/misc/tslices.nim b/tests/misc/tslices.nim index 388a46509..d063c5ebf 100644 --- a/tests/misc/tslices.nim +++ b/tests/misc/tslices.nim @@ -1,6 +1,6 @@ discard """ - file: "tslices.nim" - output: '''456456 +output: ''' +456456 456456 456456 Zugr5nd @@ -56,4 +56,3 @@ echo mystr var s = "abcdef" s[1 .. ^2] = "xyz" assert s == "axyzf" - diff --git a/tests/misc/tstrange.nim b/tests/misc/tstrange.nim index fee0f44e4..82a82d267 100644 --- a/tests/misc/tstrange.nim +++ b/tests/misc/tstrange.nim @@ -1,8 +1,9 @@ discard """ - file: "tstrange.nim" - output: '''hallo40 +output: ''' +hallo40 1 -2''' +2 +''' """ # test for extremely strange bug @@ -25,4 +26,3 @@ write(stdout, ack(5, 4)) let h=3 for x in 0.. <h.int: echo x - diff --git a/tests/misc/tvarious1.nim b/tests/misc/tvarious1.nim index 595c77919..9c0b541db 100644 --- a/tests/misc/tvarious1.nim +++ b/tests/misc/tvarious1.nim @@ -1,6 +1,6 @@ discard """ - file: "tlenopenarray.nim" - output: '''1 +output: ''' +1 0 Whopie 12 diff --git a/tests/misc/tvarnums.nim b/tests/misc/tvarnums.nim index 5daa2c4b8..39269b4c0 100644 --- a/tests/misc/tvarnums.nim +++ b/tests/misc/tvarnums.nim @@ -1,5 +1,4 @@ discard """ - file: "tvarnums.nim" output: "Success!" """ # Test variable length binary integers @@ -138,5 +137,3 @@ tm(low(int32)) tm(high(int32)) writeLine(stdout, "Success!") #OUT Success! - - diff --git a/tests/modules/timportexcept.nim b/tests/modules/timportexcept.nim index 93a7fd642..40b748088 100644 --- a/tests/modules/timportexcept.nim +++ b/tests/modules/timportexcept.nim @@ -1,10 +1,9 @@ discard """ - line: 9 errormsg: "undeclared identifier: '%'" + line: 9 """ import strutils except `%` # doesn't work echo "$1" % "abc" - diff --git a/tests/modules/tmismatchedvisibility.nim b/tests/modules/tmismatchedvisibility.nim index 2e8636d1e..4bf244807 100644 --- a/tests/modules/tmismatchedvisibility.nim +++ b/tests/modules/tmismatchedvisibility.nim @@ -1,6 +1,6 @@ discard """ - line: 8 errormsg: "public implementation 'tmismatchedvisibility.foo(a: int)[declared in tmismatchedvisibility.nim(6, 5)]' has non-public forward declaration in " + line: 8 """ proc foo(a: int): int diff --git a/tests/modules/tnamspc.nim b/tests/modules/tnamspc.nim index 2f488644c..93ce71568 100644 --- a/tests/modules/tnamspc.nim +++ b/tests/modules/tnamspc.nim @@ -1,12 +1,10 @@ discard """ + errormsg: "undeclared identifier: \'global\'" file: "tnamspc.nim" line: 10 - errormsg: "undeclared identifier: \'global\'" """ # Test17 - test correct handling of namespaces import mnamspc1 global = 9 #ERROR - - diff --git a/tests/modules/tnotuniquename.nim b/tests/modules/tnotuniquename.nim index 2d8ce4869..403c8a47e 100644 --- a/tests/modules/tnotuniquename.nim +++ b/tests/modules/tnotuniquename.nim @@ -1,6 +1,6 @@ discard """ - file: "tnotuniquename/mnotuniquename.nim" errormsg: "module names need to be unique per Nimble package" + file: "tnotuniquename/mnotuniquename.nim" """ import mnotuniquename diff --git a/tests/modules/tnotuniquename2.nim b/tests/modules/tnotuniquename2.nim index 8e486d19f..7aa4de515 100644 --- a/tests/modules/tnotuniquename2.nim +++ b/tests/modules/tnotuniquename2.nim @@ -1,6 +1,6 @@ discard """ - file: "tnotuniquename/mnotuniquename.nim" errormsg: "module names need to be unique per Nimble package" + file: "tnotuniquename/mnotuniquename.nim" """ import mnotuniquename diff --git a/tests/modules/topaque.nim b/tests/modules/topaque.nim index 84e2388bc..94ff8ff25 100644 --- a/tests/modules/topaque.nim +++ b/tests/modules/topaque.nim @@ -1,7 +1,7 @@ discard """ + errormsg: "undeclared field: \'buffer\'" file: "topaque.nim" line: 16 - errormsg: "undeclared field: \'buffer\'" """ # Test the new opaque types @@ -14,5 +14,3 @@ var L.filename = "ha" L.line = 34 L.buffer[0] = '\0' #ERROR_MSG undeclared field: 'buffer' - - diff --git a/tests/modules/trecinca.nim b/tests/modules/trecinca.nim index 7a74d7a46..56798dedd 100644 --- a/tests/modules/trecinca.nim +++ b/tests/modules/trecinca.nim @@ -1,12 +1,10 @@ discard """ + errormsg: "recursive dependency: 'trecincb.nim'" file: "trecincb.nim" line: 9 - errormsg: "recursive dependency: 'trecincb.nim'" """ # Test recursive includes include trecincb echo "trecina" - - diff --git a/tests/modules/trecincb.nim b/tests/modules/trecincb.nim index 1d3eb5503..30a5d7800 100644 --- a/tests/modules/trecincb.nim +++ b/tests/modules/trecincb.nim @@ -1,7 +1,7 @@ discard """ + errormsg: "recursive dependency: 'trecincb.nim'" file: "trecincb.nim" line: 9 - errormsg: "recursive dependency: 'trecincb.nim'" """ # Test recursive includes @@ -9,5 +9,3 @@ discard """ include trecincb echo "trecinb" - - diff --git a/tests/modules/trecmod.nim b/tests/modules/trecmod.nim index 5f053bcae..43e510e87 100644 --- a/tests/modules/trecmod.nim +++ b/tests/modules/trecmod.nim @@ -1,7 +1,7 @@ discard """ + errormsg: "recursive module dependency detected" file: "mrecmod.nim" line: 1 - errormsg: "recursive module dependency detected" disabled: true """ # recursive module diff --git a/tests/modules/tselfimport.nim b/tests/modules/tselfimport.nim index ddb3a5b09..7e50bef7c 100644 --- a/tests/modules/tselfimport.nim +++ b/tests/modules/tselfimport.nim @@ -1,9 +1,8 @@ discard """ + errormsg: "A module cannot import itself" file: "tselfimport.nim" line: 7 - errormsg: "A module cannot import itself" """ import strutils as su # guard against regression import tselfimport #ERROR echo("Hello World") - diff --git a/tests/namedparams/tnamedparams.nim b/tests/namedparams/tnamedparams.nim index 8799e8a15..d0774f0d8 100644 --- a/tests/namedparams/tnamedparams.nim +++ b/tests/namedparams/tnamedparams.nim @@ -1,7 +1,7 @@ discard """ + errormsg: "type mismatch: got <input: string, filename: string, line: int literal(1), col: int literal(23)>" file: "tnamedparams.nim" line: 8 - errormsg: "type mismatch: got <input: string, filename: string, line: int literal(1), col: int literal(23)>" """ import pegs @@ -10,6 +10,3 @@ discard parsePeg( filename = "filename", line = 1, col = 23) - - - diff --git a/tests/niminaction/Chapter2/explicit_discard.nim b/tests/niminaction/Chapter2/explicit_discard.nim index 3e94c335b..9a3b4407e 100644 --- a/tests/niminaction/Chapter2/explicit_discard.nim +++ b/tests/niminaction/Chapter2/explicit_discard.nim @@ -1,7 +1,7 @@ discard """ - line: 7 errormsg: "has to be discarded" + line: 7 """ proc myProc(name: string): string = "Hello " & name -myProc("Dominik") \ No newline at end of file +myProc("Dominik") diff --git a/tests/niminaction/Chapter2/no_def_eq.nim b/tests/niminaction/Chapter2/no_def_eq.nim index 77f0a7dd8..b9d62e036 100644 --- a/tests/niminaction/Chapter2/no_def_eq.nim +++ b/tests/niminaction/Chapter2/no_def_eq.nim @@ -1,6 +1,6 @@ discard """ - line: 16 errormsg: "type mismatch" + line: 16 """ type @@ -13,4 +13,4 @@ type let dog: Dog = Dog(name: "Fluffy") let cat: Cat = Cat(name: "Fluffy") -echo(dog == cat) \ No newline at end of file +echo(dog == cat) diff --git a/tests/niminaction/Chapter2/no_iterator.nim b/tests/niminaction/Chapter2/no_iterator.nim index 331d69480..555fac21a 100644 --- a/tests/niminaction/Chapter2/no_iterator.nim +++ b/tests/niminaction/Chapter2/no_iterator.nim @@ -1,7 +1,7 @@ discard """ - line: 6 errormsg: "type mismatch" + line: 6 """ for i in 5: - echo i \ No newline at end of file + echo i diff --git a/tests/niminaction/Chapter2/no_seq_type.nim b/tests/niminaction/Chapter2/no_seq_type.nim index 493be270a..f1494124b 100644 --- a/tests/niminaction/Chapter2/no_seq_type.nim +++ b/tests/niminaction/Chapter2/no_seq_type.nim @@ -1,6 +1,6 @@ discard """ - line: 6 errormsg: "cannot infer the type of the sequence" + line: 6 """ -var list = @[] \ No newline at end of file +var list = @[] diff --git a/tests/niminaction/Chapter2/resultreject.nim b/tests/niminaction/Chapter2/resultreject.nim index de59af7d9..87c84bf0a 100644 --- a/tests/niminaction/Chapter2/resultreject.nim +++ b/tests/niminaction/Chapter2/resultreject.nim @@ -1,13 +1,13 @@ discard """ - line: 27 errormsg: "has to be discarded" + line: 27 """ # Page 35. proc implicit: string = "I will be returned" - + proc discarded: string = discard "I will not be returned" @@ -16,7 +16,7 @@ proc explicit: string = proc resultVar: string = result = "I will be returned" - + proc resultVar2: string = result = "" result.add("I will be ") @@ -30,4 +30,4 @@ doAssert implicit() == "I will be returned" doAssert discarded() == nil doAssert explicit() == "I will be returned" doAssert resultVar() == "I will be returned" -doAssert resultVar2() == "I will be returned" \ No newline at end of file +doAssert resultVar2() == "I will be returned" diff --git a/tests/notnil/tnotnil.nim b/tests/notnil/tnotnil.nim index aff3f8959..c33b6fcac 100644 --- a/tests/notnil/tnotnil.nim +++ b/tests/notnil/tnotnil.nim @@ -1,6 +1,6 @@ discard """ - line: 13 errormsg: "type mismatch" + line: 13 """ {.experimental: "notnil".} type diff --git a/tests/objects/tobjpragma.nim b/tests/objects/tobjpragma.nim index 0a6cc893b..789b3ec4e 100644 --- a/tests/objects/tobjpragma.nim +++ b/tests/objects/tobjpragma.nim @@ -1,13 +1,14 @@ discard """ - file: "tobjpragma.nim" - output: '''2 + output: ''' +2 3 9 257 1 2 -3''' - disabled: "true" +3 +''' +disabled: "true" """ # Disabled since some versions of GCC ignore the 'packed' attribute diff --git a/tests/objects/toop1.nim b/tests/objects/toop1.nim index f4880e3c6..f22ddaf62 100644 --- a/tests/objects/toop1.nim +++ b/tests/objects/toop1.nim @@ -1,5 +1,4 @@ discard """ - file: "toop1.nim" output: "34[]o 5" """ # Test the stuff in the tutorial diff --git a/tests/objvariant/tadrdisc.nim b/tests/objvariant/tadrdisc.nim index 258fb42f3..a68dddf66 100644 --- a/tests/objvariant/tadrdisc.nim +++ b/tests/objvariant/tadrdisc.nim @@ -1,7 +1,7 @@ discard """ + errormsg: "type mismatch: got <TKind>" file: "tadrdisc.nim" line: 20 - errormsg: "type mismatch: got <TKind>" """ # Test that the address of a dicriminants cannot be taken diff --git a/tests/objvariant/temptycaseobj.nim b/tests/objvariant/temptycaseobj.nim index 53171e054..2b2c40514 100644 --- a/tests/objvariant/temptycaseobj.nim +++ b/tests/objvariant/temptycaseobj.nim @@ -1,6 +1,6 @@ discard """ - line: 11 errormsg: "identifier expected, but got 'keyword of'" + line: 11 """ type @@ -10,5 +10,3 @@ type of enA: of enU: x, y: int of enO: a, b: string - - diff --git a/tests/objvariant/tvariantstack.nim b/tests/objvariant/tvariantstack.nim index 0cdde5a20..31a0d8b82 100644 --- a/tests/objvariant/tvariantstack.nim +++ b/tests/objvariant/tvariantstack.nim @@ -1,6 +1,5 @@ discard """ - file: "tvariantstack.nim" - output: "came here" +output: "came here" """ #BUG type diff --git a/tests/openarray/t8259.nim b/tests/openarray/t8259.nim index 40ff2b2f1..c07576997 100644 --- a/tests/openarray/t8259.nim +++ b/tests/openarray/t8259.nim @@ -1,6 +1,6 @@ discard """ - line: 6 errormsg: "invalid type: 'openarray[int]' for result" + line: 6 """ proc foo(a: openArray[int]):auto = a diff --git a/tests/openarray/topena1.nim b/tests/openarray/topena1.nim index 0dbc5506a..ed3a0cedb 100644 --- a/tests/openarray/topena1.nim +++ b/tests/openarray/topena1.nim @@ -1,12 +1,9 @@ discard """ + errormsg: "invalid type" file: "topena1.nim" line: 9 - errormsg: "invalid type" """ # Tests a special bug var x: ref openarray[string] #ERROR_MSG invalid type - - - diff --git a/tests/openarray/topenarrayrepr.nim b/tests/openarray/topenarrayrepr.nim index d276756bc..3784d4bbb 100644 --- a/tests/openarray/topenarrayrepr.nim +++ b/tests/openarray/topenarrayrepr.nim @@ -1,5 +1,4 @@ discard """ - file: "topenarrayrepr.nim" output: "5 - [1]" """ type @@ -12,6 +11,3 @@ proc Bar(n: int, m: openarray[int64]) = echo($n & " - " & repr(m)) Foo(5, Bar) #OUT 5 - [1] - - - diff --git a/tests/openarray/topenlen.nim b/tests/openarray/topenlen.nim index fec8e87b7..83d58ac5c 100644 --- a/tests/openarray/topenlen.nim +++ b/tests/openarray/topenlen.nim @@ -1,5 +1,4 @@ discard """ - file: "topenlen.nim" output: "7" """ # Tests a special bug @@ -14,5 +13,3 @@ proc p(a, b: openarray[string]): int = discard choose(["sh", "-c", $p([""], ["a"])]) echo($p(["", "ha", "abc"], ["xyz"])) #OUT 7 - - diff --git a/tests/openarray/tptrarrayderef.nim b/tests/openarray/tptrarrayderef.nim index 1e73be108..5c63f6f98 100644 --- a/tests/openarray/tptrarrayderef.nim +++ b/tests/openarray/tptrarrayderef.nim @@ -1,5 +1,4 @@ discard """ - file: "tptrarrayderef.nim" output: "OK" """ @@ -15,7 +14,7 @@ var proc mutate[T](arr:openarray[T], brr: openArray[T]) = for i in 0..arr.len-1: doAssert(arr[i] == brr[i]) - + mutate(arr, arr) #bug #2240 @@ -46,9 +45,9 @@ proc getFilledBuffer(sz: int): ref seq[char] = s[] = newSeq[char](sz) fillBuffer(s[]) return s - + let aa = getFilledBuffer(3) for i in 0..aa[].len-1: doAssert(aa[i] == chr(i)) - -echo "OK" \ No newline at end of file + +echo "OK" diff --git a/tests/osproc/texecps.nim b/tests/osproc/texecps.nim index 887d79bfb..780adb7ce 100644 --- a/tests/osproc/texecps.nim +++ b/tests/osproc/texecps.nim @@ -1,5 +1,4 @@ discard """ - file: "texecps.nim" output: "" """ diff --git a/tests/osproc/texitcode.nim b/tests/osproc/texitcode.nim index 6dc5508b5..558017716 100644 --- a/tests/osproc/texitcode.nim +++ b/tests/osproc/texitcode.nim @@ -1,5 +1,4 @@ discard """ - file: "texitcode.nim" output: "" """ diff --git a/tests/osproc/tstdin.nim b/tests/osproc/tstdin.nim index 9b49ed786..8579680ab 100644 --- a/tests/osproc/tstdin.nim +++ b/tests/osproc/tstdin.nim @@ -1,5 +1,4 @@ discard """ - file: "tstdin.nim" output: "10" """ import osproc, os, streams diff --git a/tests/osproc/tworkingdir.nim b/tests/osproc/tworkingdir.nim index 7d58d5ae6..3a3c1b6ab 100644 --- a/tests/osproc/tworkingdir.nim +++ b/tests/osproc/tworkingdir.nim @@ -1,5 +1,4 @@ discard """ - file: "tworkingdir.nim" output: "" """ diff --git a/tests/overflw/toverflw.nim b/tests/overflw/toverflw.nim index 20bc56a53..aef597e6c 100644 --- a/tests/overflw/toverflw.nim +++ b/tests/overflw/toverflw.nim @@ -1,8 +1,6 @@ discard """ - file: "toverflw.nim" output: "ok" cmd: "nim $target -d:release $options $file" - """ # Tests nim's ability to detect overflows diff --git a/tests/overflw/toverflw2.nim b/tests/overflw/toverflw2.nim index 75bd4cdf5..91b900ca4 100644 --- a/tests/overflw/toverflw2.nim +++ b/tests/overflw/toverflw2.nim @@ -1,10 +1,7 @@ discard """ - file: "toverflw2.nim" outputsub: "Error: unhandled exception: over- or underflow [OverflowError]" exitcode: "1" """ var a : int32 = 2147483647 var b : int32 = 2147483647 var c = a + b - - diff --git a/tests/overflw/tovfint.nim b/tests/overflw/tovfint.nim index f775d2e1c..5c440a540 100644 --- a/tests/overflw/tovfint.nim +++ b/tests/overflw/tovfint.nim @@ -1,5 +1,4 @@ discard """ - file: "tovfint.nim" output: "works!" """ # this tests the new overflow literals @@ -19,5 +18,3 @@ else: write(stdout, "broken!\n") #OUT works! - - diff --git a/tests/overload/toverl.nim b/tests/overload/toverl.nim index 807b643a4..64257be77 100644 --- a/tests/overload/toverl.nim +++ b/tests/overload/toverl.nim @@ -1,7 +1,7 @@ discard """ + errormsg: "redefinition of \'TNone\'" file: "toverl.nim" line: 11 - errormsg: "redefinition of \'TNone\'" """ # Test for overloading @@ -9,5 +9,3 @@ type TNone {.exportc: "_NONE", final.} = object proc TNone(a, b: int) = nil #ERROR_MSG attempt to redefine 'TNone' - - diff --git a/tests/parallel/tgc_unsafe2.nim b/tests/parallel/tgc_unsafe2.nim index 40bfbdadb..0a56a23aa 100644 --- a/tests/parallel/tgc_unsafe2.nim +++ b/tests/parallel/tgc_unsafe2.nim @@ -1,10 +1,10 @@ discard """ + errormsg: "'consumer' is not GC-safe as it calls 'track'" line: 28 nimout: '''tgc_unsafe2.nim(22, 6) Warning: 'trick' is not GC-safe as it accesses 'global' which is a global using GC'ed memory [GcUnsafe2] tgc_unsafe2.nim(26, 6) Warning: 'track' is not GC-safe as it calls 'trick' [GcUnsafe2] tgc_unsafe2.nim(28, 6) Error: 'consumer' is not GC-safe as it calls 'track' ''' - errormsg: "'consumer' is not GC-safe as it calls 'track'" """ import threadpool diff --git a/tests/parallel/tsysspawnbadarg.nim b/tests/parallel/tsysspawnbadarg.nim index 2d3ffd241..a8f1ed401 100644 --- a/tests/parallel/tsysspawnbadarg.nim +++ b/tests/parallel/tsysspawnbadarg.nim @@ -1,6 +1,6 @@ discard """ - line: 9 errormsg: "'spawn' takes a call expression" + line: 9 cmd: "nim $target --threads:on $options $file" """ diff --git a/tests/parser/tdomulttest.nim b/tests/parser/tdomulttest.nim index 418192ac8..9e1afd034 100644 --- a/tests/parser/tdomulttest.nim +++ b/tests/parser/tdomulttest.nim @@ -1,14 +1,14 @@ discard """ - file: "tdomulttest.nim" output: "555\ntest\nmulti lines\n99999999\nend" - disabled: true """ + proc foo(bar, baz: proc (x: int): int) = echo bar(555) echo baz(99999999) foo do (x: int) -> int: return x + do (x: int) -> int: echo("test") echo("multi lines") diff --git a/tests/parser/tinvcolonlocation1.nim b/tests/parser/tinvcolonlocation1.nim index 2fddab2f8..7fca5deb7 100644 --- a/tests/parser/tinvcolonlocation1.nim +++ b/tests/parser/tinvcolonlocation1.nim @@ -1,8 +1,8 @@ discard """ + errormsg: "expected: ':', but got: 'echo'" file: "tinvcolonlocation1.nim" line: 8 column: 7 - errormsg: "expected: ':', but got: 'echo'" """ try #<- missing ':' echo "try" diff --git a/tests/parser/tinvcolonlocation2.nim b/tests/parser/tinvcolonlocation2.nim index 4251598b9..e3de393b8 100644 --- a/tests/parser/tinvcolonlocation2.nim +++ b/tests/parser/tinvcolonlocation2.nim @@ -1,8 +1,8 @@ discard """ + errormsg: "expected: ':', but got: 'keyword finally'" file: "tinvcolonlocation2.nim" line: 11 column: 8 - errormsg: "expected: ':', but got: 'keyword finally'" """ try: echo "try" diff --git a/tests/parser/tinvcolonlocation3.nim b/tests/parser/tinvcolonlocation3.nim index a8db658eb..46252f24e 100644 --- a/tests/parser/tinvcolonlocation3.nim +++ b/tests/parser/tinvcolonlocation3.nim @@ -1,8 +1,8 @@ discard """ + errormsg: "expected: ':', but got: 'echo'" file: "tinvcolonlocation3.nim" line: 12 column: 7 - errormsg: "expected: ':', but got: 'echo'" """ try: echo "try" diff --git a/tests/parser/tinvwhen.nim b/tests/parser/tinvwhen.nim index 99701bdf5..7a47f69a4 100644 --- a/tests/parser/tinvwhen.nim +++ b/tests/parser/tinvwhen.nim @@ -1,7 +1,7 @@ discard """ + errormsg: "invalid indentation" file: "tinvwhen.nim" line: 11 - errormsg: "invalid indentation" """ # This was parsed even though it should not! @@ -11,5 +11,3 @@ proc getcwd(buf: cstring, buflen: cint): cstring when defined(unix): {.importc: "getcwd", header: "<unistd.h>".} #ERROR_MSG invalid indentation elif defined(windows): {.importc: "getcwd", header: "<direct.h>"} else: {.error: "os library not ported to your OS. Please help!".} - - diff --git a/tests/parser/toprprec.nim b/tests/parser/toprprec.nim index 1acd381e7..363ad1c18 100644 --- a/tests/parser/toprprec.nim +++ b/tests/parser/toprprec.nim @@ -1,5 +1,4 @@ discard """ - file: "toprprec.nim" output: "done" """ # Test operator precedence: diff --git a/tests/parser/ttupleunpack.nim b/tests/parser/ttupleunpack.nim index aaa06f9f4..c7ab9ea15 100644 --- a/tests/parser/ttupleunpack.nim +++ b/tests/parser/ttupleunpack.nim @@ -1,9 +1,3 @@ -discard """ - file: "ttupleunpack.nim" - output: "" - exitcode: 0 -""" - proc returnsTuple(): (int, int, int) = (4, 2, 3) proc main2 = diff --git a/tests/pragmas/t6448.nim b/tests/pragmas/t6448.nim index 61e4a35d9..a1bd747a0 100644 --- a/tests/pragmas/t6448.nim +++ b/tests/pragmas/t6448.nim @@ -1,6 +1,6 @@ discard """ - line: 9 errormsg: '''ambiguous call; both foobar.async''' + line: 9 """ import foobar @@ -9,7 +9,7 @@ import asyncdispatch, macros proc bar() {.async.} = echo 42 -proc foo() {.async.} = +proc foo() {.async.} = await bar() asyncCheck foo() diff --git a/tests/pragmas/t8741.nim b/tests/pragmas/t8741.nim index 41f2f9e8a..c132c3543 100644 --- a/tests/pragmas/t8741.nim +++ b/tests/pragmas/t8741.nim @@ -1,6 +1,6 @@ discard """ - line: 9 errormsg: "cannot attach a custom pragma to 'a'" + line: 9 """ for a {.gensym, inject.} in @[1,2,3]: diff --git a/tests/pragmas/tuserpragma2.nim b/tests/pragmas/tuserpragma2.nim index bf8844e66..ce16c4649 100644 --- a/tests/pragmas/tuserpragma2.nim +++ b/tests/pragmas/tuserpragma2.nim @@ -1,7 +1,7 @@ discard """ + errormsg: "can raise an unlisted exception: ref Exception" file: "tuserpragma2.nim" line: 11 - errormsg: "can raise an unlisted exception: ref Exception" """ # bug #7216 diff --git a/tests/proc/tprocredef.nim b/tests/proc/tprocredef.nim index 4ec771510..0cd6ec770 100644 --- a/tests/proc/tprocredef.nim +++ b/tests/proc/tprocredef.nim @@ -1,9 +1,8 @@ discard """ + errormsg: "redefinition of \'foo\'" file: "tprocredef.nim" line: 8 - errormsg: "redefinition of \'foo\'" """ proc foo(a: int, b: string) = discard proc foo(a: int, b: string) = discard - diff --git a/tests/range/tsubrange.nim b/tests/range/tsubrange.nim index 914e7c6e7..f778c55eb 100644 --- a/tests/range/tsubrange.nim +++ b/tests/range/tsubrange.nim @@ -1,6 +1,6 @@ discard """ - line: 20 errormsg: "cannot convert 60 to TRange" + line: 20 """ type @@ -18,4 +18,3 @@ p y const myConst: TRange = 60 - diff --git a/tests/range/tsubrange2.nim b/tests/range/tsubrange2.nim index 7097faed2..e0fb71c5f 100644 --- a/tests/range/tsubrange2.nim +++ b/tests/range/tsubrange2.nim @@ -1,5 +1,4 @@ discard """ - file: "tsubrange2.nim" outputsub: "value out of range: 50 [RangeError]" exitcode: "1" """ @@ -14,4 +13,3 @@ var r: TRange y = 50 p y - diff --git a/tests/range/tsubrange3.nim b/tests/range/tsubrange3.nim index f5bb2f161..d3aae87df 100644 --- a/tests/range/tsubrange3.nim +++ b/tests/range/tsubrange3.nim @@ -1,5 +1,4 @@ discard """ - file: "tsubrange.nim" outputsub: "value out of range: 50 [RangeError]" exitcode: "1" """ diff --git a/tests/rational/trat_float.nim b/tests/rational/trat_float.nim index 24797c4a0..663973bf9 100644 --- a/tests/rational/trat_float.nim +++ b/tests/rational/trat_float.nim @@ -1,7 +1,7 @@ discard """ + errormsg: '''type mismatch: got''' file: "trat_float.nim" line: "9,19" - errormsg: '''type mismatch: got''' """ import rationals var diff --git a/tests/sets/t2669.nim b/tests/sets/t2669.nim index 6b8eb0f54..0a92818fa 100644 --- a/tests/sets/t2669.nim +++ b/tests/sets/t2669.nim @@ -1,6 +1,6 @@ discard """ -line: 6 errormsg: "cannot convert 6 to range 1..5(int8)" +line: 6 """ var c: set[range[1i8..5i8]] = {1i8, 2i8, 6i8} diff --git a/tests/sets/tsets.nim b/tests/sets/tsets.nim index 13a5f54e6..bde25cf81 100644 --- a/tests/sets/tsets.nim +++ b/tests/sets/tsets.nim @@ -1,7 +1,8 @@ discard """ - file: "tsets.nim" - output: '''Ha ein F ist in s! -false''' +output: ''' +Ha ein F ist in s! +false +''' """ # Test the handling of sets diff --git a/tests/stdlib/t8925.nim b/tests/stdlib/t8925.nim index d3dc1ea86..dbf55fd88 100644 --- a/tests/stdlib/t8925.nim +++ b/tests/stdlib/t8925.nim @@ -1,6 +1,6 @@ discard """ - file: "strscans.nim" errormsg: "type mismatch between pattern '$i' (position: 1) and HourRange var 'hour'" + file: "strscans.nim" """ import strscans diff --git a/tests/stdlib/tbitops.nim b/tests/stdlib/tbitops.nim index 8301256c4..d8c6da1d4 100644 --- a/tests/stdlib/tbitops.nim +++ b/tests/stdlib/tbitops.nim @@ -1,5 +1,4 @@ discard """ - file: "tbitops.nim" output: "OK" """ import bitops diff --git a/tests/stdlib/tbitops2.nim b/tests/stdlib/tbitops2.nim index 31952316c..e8c7318be 100644 --- a/tests/stdlib/tbitops2.nim +++ b/tests/stdlib/tbitops2.nim @@ -1,5 +1,4 @@ discard """ - file: "tbitops.nim" output: "OK" """ import bitops diff --git a/tests/stdlib/tcgi.nim b/tests/stdlib/tcgi.nim index 23b8b82ca..bc177125e 100644 --- a/tests/stdlib/tcgi.nim +++ b/tests/stdlib/tcgi.nim @@ -1,9 +1,3 @@ -discard """ - action: run - file: tcgi.nim - output: "[Suite] Test cgi module" -""" - import unittest import cgi, strtabs diff --git a/tests/stdlib/tjsonmacro.nim b/tests/stdlib/tjsonmacro.nim index bf0bb3ea7..4ba0cdecc 100644 --- a/tests/stdlib/tjsonmacro.nim +++ b/tests/stdlib/tjsonmacro.nim @@ -1,5 +1,4 @@ discard """ - file: "tjsonmacro.nim" output: "" """ import json, strutils, options, tables diff --git a/tests/stdlib/tjsonmacro_reject.nim b/tests/stdlib/tjsonmacro_reject.nim index 00506449f..ada365d7d 100644 --- a/tests/stdlib/tjsonmacro_reject.nim +++ b/tests/stdlib/tjsonmacro_reject.nim @@ -1,7 +1,7 @@ discard """ + errormsg: "Use a named tuple instead of: (string, float)" file: "tjsonmacro_reject.nim" line: 11 - errormsg: "Use a named tuple instead of: (string, float)" """ import json @@ -15,4 +15,4 @@ let j = """ {"engine": {"name": "V8", "capacity": 5.5}, model: "Skyline"} """ let parsed = parseJson(j) -echo(to(parsed, Car)) \ No newline at end of file +echo(to(parsed, Car)) diff --git a/tests/stdlib/tjsonmacro_reject2.nim b/tests/stdlib/tjsonmacro_reject2.nim index b01153553..e13dad307 100644 --- a/tests/stdlib/tjsonmacro_reject2.nim +++ b/tests/stdlib/tjsonmacro_reject2.nim @@ -1,7 +1,7 @@ discard """ + errormsg: "The `to` macro does not support ref objects with cycles." file: "tjsonmacro_reject2.nim" line: 10 - errormsg: "The `to` macro does not support ref objects with cycles." """ import json @@ -18,4 +18,4 @@ let data = """ """ let dataParsed = parseJson(data) -let dataDeser = to(dataParsed, Cycle) \ No newline at end of file +let dataDeser = to(dataParsed, Cycle) diff --git a/tests/stdlib/tmemfiles1.nim b/tests/stdlib/tmemfiles1.nim index a18fba083..21a65369f 100644 --- a/tests/stdlib/tmemfiles1.nim +++ b/tests/stdlib/tmemfiles1.nim @@ -1,7 +1,3 @@ -discard """ - file: "tmemfiles1.nim" - outputsub: "" -""" import memfiles, os var mm: MemFile diff --git a/tests/stdlib/tmemmapstreams.nim b/tests/stdlib/tmemmapstreams.nim index 243574f1a..dd011d777 100644 --- a/tests/stdlib/tmemmapstreams.nim +++ b/tests/stdlib/tmemmapstreams.nim @@ -1,6 +1,6 @@ discard """ - file: "tmemmapstreams.nim" - output: '''Created size: 10 +output: ''' +Created size: 10 Position after writing: 5 Position after writing one char: 6 Peeked data: Hello diff --git a/tests/stdlib/tospaths.nim b/tests/stdlib/tospaths.nim index 9e2a5605c..bee9bab76 100644 --- a/tests/stdlib/tospaths.nim +++ b/tests/stdlib/tospaths.nim @@ -1,5 +1,4 @@ discard """ - file: "tospaths.nim" output: "" """ # test the ospaths module diff --git a/tests/stdlib/tosproc.nim b/tests/stdlib/tosproc.nim index ac129e709..9d57d4574 100644 --- a/tests/stdlib/tosproc.nim +++ b/tests/stdlib/tosproc.nim @@ -1,5 +1,4 @@ discard """ - file: "tospaths.nim" output: "" """ # test the osproc module diff --git a/tests/stdlib/tparsesql.nim b/tests/stdlib/tparsesql.nim index 126020ed6..8cf8fa848 100644 --- a/tests/stdlib/tparsesql.nim +++ b/tests/stdlib/tparsesql.nim @@ -1,7 +1,3 @@ -discard """ - file: "tparsesql.nim" -""" - import parsesql doAssert $parseSQL("SELECT foo FROM table;") == "select foo from table;" diff --git a/tests/stdlib/tregex.nim b/tests/stdlib/tregex.nim index ae6714de1..21f4e6743 100644 --- a/tests/stdlib/tregex.nim +++ b/tests/stdlib/tregex.nim @@ -1,5 +1,4 @@ discard """ - file: "tregex.nim" output: "key: keyAYes!" """ # Test the new regular expression module @@ -27,5 +26,3 @@ else: echo("Bug!") #OUT key: keyAYes! - - diff --git a/tests/stdlib/trepr.nim b/tests/stdlib/trepr.nim index 18fe7e054..33cb581ef 100644 --- a/tests/stdlib/trepr.nim +++ b/tests/stdlib/trepr.nim @@ -1,5 +1,4 @@ discard """ - file: "trepr.nim" output: "{a, b}{'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'}" """ @@ -26,4 +25,3 @@ when false: # "a", "b", "c", "d", "e" #] #echo(repr(testseq)) - diff --git a/tests/stdlib/tstreams2.nim b/tests/stdlib/tstreams2.nim index 90102d8e3..70f0bac32 100644 --- a/tests/stdlib/tstreams2.nim +++ b/tests/stdlib/tstreams2.nim @@ -1,5 +1,4 @@ discard """ - file: "tstreams2.nim" output: '''fs is: nil''' """ import streams diff --git a/tests/stdlib/tstreams3.nim b/tests/stdlib/tstreams3.nim index b2c9170e3..e3b395e05 100644 --- a/tests/stdlib/tstreams3.nim +++ b/tests/stdlib/tstreams3.nim @@ -1,5 +1,4 @@ discard """ - file: "tstreams3.nim" output: "threw exception" """ import streams diff --git a/tests/stdlib/tstring.nim b/tests/stdlib/tstring.nim index 660746150..852ff4fb7 100644 --- a/tests/stdlib/tstring.nim +++ b/tests/stdlib/tstring.nim @@ -1,5 +1,4 @@ discard """ - file: "tstring.nim" output: "OK" """ const characters = "abcdefghijklmnopqrstuvwxyz" diff --git a/tests/stdlib/tstrutil.nim b/tests/stdlib/tstrutil.nim index 64b8f8ecc..fffa85bd1 100644 --- a/tests/stdlib/tstrutil.nim +++ b/tests/stdlib/tstrutil.nim @@ -1,5 +1,4 @@ discard """ - file: "tstrutil.nim" output: "ha/home/a1xyz/usr/bin" """ # test the new strutils module diff --git a/tests/stdlib/tsugar.nim b/tests/stdlib/tsugar.nim index a870bf6fe..111ca96a4 100644 --- a/tests/stdlib/tsugar.nim +++ b/tests/stdlib/tsugar.nim @@ -1,5 +1,4 @@ discard """ - file: "tsugar.nim" output: "" """ import sugar diff --git a/tests/stdlib/ttimes.nim b/tests/stdlib/ttimes.nim index 7ebbe61d9..ed87b15ac 100644 --- a/tests/stdlib/ttimes.nim +++ b/tests/stdlib/ttimes.nim @@ -1,8 +1,5 @@ discard """ - file: "ttimes.nim" target: "c js" - output: '''[Suite] ttimes -''' """ import times, strutils, unittest @@ -125,7 +122,7 @@ suite "ttimes": when defined(linux) or defined(macosx): let tz_dir = getEnv("TZDIR", "/usr/share/zoneinfo") const f = "yyyy-MM-dd HH:mm zzz" - + let orig_tz = getEnv("TZ") var tz_cnt = 0 for tz_fn in walkFiles(tz_dir & "/**/*"): @@ -152,7 +149,7 @@ suite "ttimes": check initDateTime(29, mOct, 2017, 01, 00, 00).isDst check initDateTime(29, mOct, 2017, 03, 01, 00).format(f) == "2017-10-29 03:01 +01:00" check (not initDateTime(29, mOct, 2017, 03, 01, 00).isDst) - + check initDateTime(21, mOct, 2017, 01, 00, 00).format(f) == "2017-10-21 01:00 +02:00" test "issue #6520": @@ -170,10 +167,10 @@ suite "ttimes": check diff == initDuration(seconds = 2208986872) test "issue #6465": - putEnv("TZ", "Europe/Stockholm") + putEnv("TZ", "Europe/Stockholm") let dt = parse("2017-03-25 12:00", "yyyy-MM-dd hh:mm") check $(dt + initTimeInterval(days = 1)) == "2017-03-26T12:00:00+02:00" - check $(dt + initDuration(days = 1)) == "2017-03-26T13:00:00+02:00" + check $(dt + initDuration(days = 1)) == "2017-03-26T13:00:00+02:00" test "datetime before epoch": check $fromUnix(-2147483648).utc == "1901-12-13T20:45:52Z" diff --git a/tests/template/ttempl2.nim b/tests/template/ttempl2.nim index aaa2f1344..eb67bea0c 100644 --- a/tests/template/ttempl2.nim +++ b/tests/template/ttempl2.nim @@ -1,7 +1,7 @@ discard """ + errormsg: "undeclared identifier: \'b\'" file: "ttempl2.nim" line: 18 - errormsg: "undeclared identifier: \'b\'" """ template declareInScope(x: untyped, t: typeDesc): untyped {.immediate.} = var x: t @@ -16,4 +16,3 @@ a = 42 # works, `a` is known here declareInNewScope(b, int) b = 42 #ERROR_MSG undeclared identifier: 'b' - diff --git a/tests/threads/tthreadanalysis2.nim b/tests/threads/tthreadanalysis2.nim index c1ec3ae39..067e186a8 100644 --- a/tests/threads/tthreadanalysis2.nim +++ b/tests/threads/tthreadanalysis2.nim @@ -1,7 +1,7 @@ discard """ + errormsg: "'threadFunc' is not GC-safe" file: "tthreadanalysis2.nim" line: 37 - errormsg: "'threadFunc' is not GC-safe" cmd: "nim $target --hints:on --threads:on $options $file" """ @@ -49,4 +49,3 @@ proc main = joinThreads(thr) main() - diff --git a/tests/threads/tthreadheapviolation1.nim b/tests/threads/tthreadheapviolation1.nim index 59ecb742c..379bd55e6 100644 --- a/tests/threads/tthreadheapviolation1.nim +++ b/tests/threads/tthreadheapviolation1.nim @@ -1,6 +1,6 @@ discard """ - line: 11 errormsg: "'horrible' is not GC-safe" + line: 11 cmd: "nim $target --hints:on --threads:on $options $file" """ @@ -16,5 +16,3 @@ proc horrible() {.thread.} = createThread[void](t, horrible) joinThread(t) - - diff --git a/tests/trmacros/tdisallowif.nim b/tests/trmacros/tdisallowif.nim index 18dfd1c82..36f60800e 100644 --- a/tests/trmacros/tdisallowif.nim +++ b/tests/trmacros/tdisallowif.nim @@ -1,6 +1,6 @@ discard """ - line: 24 errormsg: "usage of 'disallowIf' is a user-defined error" + line: 24 disabled: true """ diff --git a/tests/tuples/twrongtupleaccess.nim b/tests/tuples/twrongtupleaccess.nim index b1684b097..591716a2e 100644 --- a/tests/tuples/twrongtupleaccess.nim +++ b/tests/tuples/twrongtupleaccess.nim @@ -1,10 +1,9 @@ discard """ + errormsg: "attempting to call undeclared routine: \'setBLAH\'" file: "twrongtupleaccess.nim" line: 9 - errormsg: "attempting to call undeclared routine: \'setBLAH\'" """ # Bugfix var v = (5.0, 10.0) v.setBLAH(10) - diff --git a/tests/typerel/t8172.nim b/tests/typerel/t8172.nim index 8e0b32932..57b788250 100644 --- a/tests/typerel/t8172.nim +++ b/tests/typerel/t8172.nim @@ -1,6 +1,6 @@ discard """ - line: 11 errormsg: "cannot convert array[0..0, string] to varargs[string]" + line: 11 """ proc f(v: varargs[string]) = diff --git a/tests/typerel/temptynode.nim b/tests/typerel/temptynode.nim index df308fbc2..8c71a6092 100644 --- a/tests/typerel/temptynode.nim +++ b/tests/typerel/temptynode.nim @@ -1,6 +1,6 @@ discard """ - line: 16 errormsg: "type mismatch: got <void>" + line: 16 """ # bug #950 diff --git a/tests/typerel/tno_int_in_bool_context.nim b/tests/typerel/tno_int_in_bool_context.nim index a4b4237d2..66e9da58a 100644 --- a/tests/typerel/tno_int_in_bool_context.nim +++ b/tests/typerel/tno_int_in_bool_context.nim @@ -1,8 +1,7 @@ discard """ - line: 6 errormsg: "type mismatch: got <int literal(1)> but expected 'bool'" + line: 6 """ if 1: echo "wtf?" - diff --git a/tests/typerel/tnocontains.nim b/tests/typerel/tnocontains.nim index a93db2fc3..8bea8aa56 100644 --- a/tests/typerel/tnocontains.nim +++ b/tests/typerel/tnocontains.nim @@ -1,7 +1,7 @@ discard """ + errormsg: "type mismatch: got <string, string>" file: "tnocontains.nim" line: 10 - errormsg: "type mismatch: got <string, string>" """ # shouldn't compile since it doesn't do what you think it does without diff --git a/tests/typerel/trefs.nim b/tests/typerel/trefs.nim index d4383c562..e9862bd0f 100644 --- a/tests/typerel/trefs.nim +++ b/tests/typerel/trefs.nim @@ -1,7 +1,7 @@ discard """ + errormsg: "type mismatch" file: "trefs.nim" line: 20 - errormsg: "type mismatch" """ # test for ref types (including refs to procs) @@ -18,6 +18,3 @@ var p: TProc p = foo write(stdout, "success!") p = wrongfoo #ERROR_MSG type mismatch - - - diff --git a/tests/typerel/tregionptrs.nim b/tests/typerel/tregionptrs.nim index 9eeded18b..504ec1011 100644 --- a/tests/typerel/tregionptrs.nim +++ b/tests/typerel/tregionptrs.nim @@ -1,6 +1,6 @@ discard """ - line: 16 errormsg: "type mismatch: got <BPtr> but expected 'APtr = ptr[RegionA, int]'" + line: 16 """ type diff --git a/tests/typerel/ttypedesc_as_genericparam1.nim b/tests/typerel/ttypedesc_as_genericparam1.nim index 9ae464842..b7c3e727d 100644 --- a/tests/typerel/ttypedesc_as_genericparam1.nim +++ b/tests/typerel/ttypedesc_as_genericparam1.nim @@ -1,6 +1,6 @@ discard """ - line: 6 errormsg: "type mismatch: got <type int>" + line: 6 """ # bug #3079, #1146 echo repr(int) diff --git a/tests/typerel/ttypedesc_as_genericparam2.nim b/tests/typerel/ttypedesc_as_genericparam2.nim index 0b4281269..ea06606f9 100644 --- a/tests/typerel/ttypedesc_as_genericparam2.nim +++ b/tests/typerel/ttypedesc_as_genericparam2.nim @@ -1,6 +1,6 @@ discard """ - line: 9 errormsg: "'repr' doesn't support 'void' type" + line: 9 """ # bug #2879 diff --git a/tests/typerel/ttypenoval.nim b/tests/typerel/ttypenoval.nim index 720e5d662..c7829f9dd 100644 --- a/tests/typerel/ttypenoval.nim +++ b/tests/typerel/ttypenoval.nim @@ -1,7 +1,7 @@ discard """ + errormsg: "type mismatch: got <type int> but expected 'int'" file: "ttypenoval.nim" line: 38 - errormsg: "type mismatch: got <type int> but expected 'int'" """ # A min-heap. @@ -51,5 +51,3 @@ var newBinHeap(heap, 256) add(heap, 1, 100) print(heap) - - diff --git a/tests/typerel/typredef.nim b/tests/typerel/typredef.nim index 0b6aed875..c502a834c 100644 --- a/tests/typerel/typredef.nim +++ b/tests/typerel/typredef.nim @@ -1,8 +1,7 @@ discard """ + errormsg: "illegal recursion in type \'Uint8\'" file: "typredef.nim" line: 7 - errormsg: "illegal recursion in type \'Uint8\'" """ type Uint8 = Uint8 #ERROR_MSG illegal recursion in type 'Uint8' - diff --git a/tests/types/t6456.nim b/tests/types/t6456.nim index 2d2aad370..19bbc2c02 100644 --- a/tests/types/t6456.nim +++ b/tests/types/t6456.nim @@ -1,6 +1,6 @@ discard """ - line: 6 errormsg: "type \'ptr void\' is not allowed" + line: 6 """ proc foo(x: ptr void) = diff --git a/tests/types/tassignemptytuple.nim b/tests/types/tassignemptytuple.nim index bdfc653a5..9d5a311ba 100644 --- a/tests/types/tassignemptytuple.nim +++ b/tests/types/tassignemptytuple.nim @@ -1,7 +1,7 @@ discard """ + errormsg: "cannot infer the type of the tuple" file: "tassignemptytuple.nim" line: 11 - errormsg: "cannot infer the type of the tuple" """ var diff --git a/tests/types/tillrec.nim b/tests/types/tillrec.nim index 18757140a..7584282b6 100644 --- a/tests/types/tillrec.nim +++ b/tests/types/tillrec.nim @@ -1,7 +1,7 @@ discard """ + errormsg: "illegal recursion in type \'TIllegal\'" file: "tillrec.nim" line: 13 - errormsg: "illegal recursion in type \'TIllegal\'" """ # test illegal recursive types @@ -13,4 +13,3 @@ type TIllegal {.final.} = object #ERROR_MSG illegal recursion in type 'TIllegal' y: int x: array[0..3, TIllegal] - diff --git a/tests/types/tparameterizedparent0.nim b/tests/types/tparameterizedparent0.nim index 1b72a4e21..90e7a9c0c 100644 --- a/tests/types/tparameterizedparent0.nim +++ b/tests/types/tparameterizedparent0.nim @@ -1,7 +1,7 @@ discard """ + errormsg: "inheritance only works with non-final objects" file: "tparameterizedparent0.nim" line: 14 - errormsg: "inheritance only works with non-final objects" """ # bug #5264 type diff --git a/tests/types/tparameterizedparent1.nim b/tests/types/tparameterizedparent1.nim index 24fb9a565..5da8189f4 100644 --- a/tests/types/tparameterizedparent1.nim +++ b/tests/types/tparameterizedparent1.nim @@ -1,7 +1,7 @@ discard """ + errormsg: "inheritance only works with non-final objects" file: "tparameterizedparent1.nim" line: 14 - errormsg: "inheritance only works with non-final objects" """ # bug #5264 type diff --git a/tests/types/tparameterizedparent3.nim b/tests/types/tparameterizedparent3.nim index 58aaf80ea..fcca6453e 100644 --- a/tests/types/tparameterizedparent3.nim +++ b/tests/types/tparameterizedparent3.nim @@ -1,7 +1,7 @@ discard """ + errormsg: "attempt to redefine: 'color'" file: "tparameterizedparent3.nim" line: 13 - errormsg: "attempt to redefine: 'color'" """ # bug #5264 type diff --git a/tests/types/tparameterizedparent4.nim b/tests/types/tparameterizedparent4.nim index a37461bb4..4759d9d9b 100644 --- a/tests/types/tparameterizedparent4.nim +++ b/tests/types/tparameterizedparent4.nim @@ -1,7 +1,7 @@ discard """ + errormsg: "attempt to redefine: 'grain'" file: "tparameterizedparent4.nim" line: 23 - errormsg: "attempt to redefine: 'grain'" """ # bug #5264 type diff --git a/tests/usingstmt/tusingstatement.nim b/tests/usingstmt/tusingstatement.nim index 8585bcc9e..fc050ee5b 100644 --- a/tests/usingstmt/tusingstatement.nim +++ b/tests/usingstmt/tusingstatement.nim @@ -1,5 +1,4 @@ discard """ - file: "tusingstatement.nim" output: "Using test.Closing test." """ diff --git a/tests/varres/tnewseq_on_result_vart.nim b/tests/varres/tnewseq_on_result_vart.nim index 18935a1d1..4a700468f 100644 --- a/tests/varres/tnewseq_on_result_vart.nim +++ b/tests/varres/tnewseq_on_result_vart.nim @@ -1,7 +1,7 @@ discard """ - line: 9 errormsg: "address of 'result' may not escape its stack frame" + line: 9 """ # bug #5113 diff --git a/tests/varres/tprevent_forloopvar_mutations.nim b/tests/varres/tprevent_forloopvar_mutations.nim index 15938bb77..43cc04f30 100644 --- a/tests/varres/tprevent_forloopvar_mutations.nim +++ b/tests/varres/tprevent_forloopvar_mutations.nim @@ -1,6 +1,6 @@ discard """ - line: 15 errmsg: "type mismatch: got <int>" + line: 15 nimout: '''type mismatch: got <int> but expected one of: proc inc[T: Ordinal | uint | uint64](x: var T; y = 1) diff --git a/tests/varres/tvarres1.nim b/tests/varres/tvarres1.nim index 5a5247142..e58d7f083 100644 --- a/tests/varres/tvarres1.nim +++ b/tests/varres/tvarres1.nim @@ -1,7 +1,7 @@ discard """ + errormsg: "'bla' escapes its stack frame; context: 'bla'" file: "tvarres1.nim" line: 12 - errormsg: "'bla' escapes its stack frame; context: 'bla'" """ var @@ -14,4 +14,3 @@ proc p(): var int = p() = 45 echo g - diff --git a/tests/varres/tvarres2.nim b/tests/varres/tvarres2.nim index 53a57d882..4ec0bb05b 100644 --- a/tests/varres/tvarres2.nim +++ b/tests/varres/tvarres2.nim @@ -1,7 +1,7 @@ discard """ + errormsg: "expression has no address" file: "tvarres2.nim" line: 11 - errormsg: "expression has no address" """ var @@ -13,4 +13,3 @@ proc p(): var int = p() = 45 echo g - diff --git a/tests/varres/tvarres_via_forwarding.nim b/tests/varres/tvarres_via_forwarding.nim index 8fd3dfcfd..fb7201ad2 100644 --- a/tests/varres/tvarres_via_forwarding.nim +++ b/tests/varres/tvarres_via_forwarding.nim @@ -1,6 +1,6 @@ discard """ - line: 10 errormsg: "'y' escapes its stack frame; context: 'forward(y)'" + line: 10 """ proc forward(x: var int): var int = result = x diff --git a/tests/varres/tvartup.nim b/tests/varres/tvartup.nim index 1957a3e35..a8f15b232 100644 --- a/tests/varres/tvartup.nim +++ b/tests/varres/tvartup.nim @@ -1,5 +1,4 @@ discard """ - file: "tvartup.nim" output: "2 3" """ # Test the new tuple unpacking @@ -9,5 +8,3 @@ proc divmod(a, b: int): tuple[di, mo: int] = var (x, y) = divmod(15, 6) echo x, " ", y - -#OUT 2 3 diff --git a/tests/varres/twrong_parameter.nim b/tests/varres/twrong_parameter.nim index 8a363dd19..58d01fd7e 100644 --- a/tests/varres/twrong_parameter.nim +++ b/tests/varres/twrong_parameter.nim @@ -1,6 +1,6 @@ discard """ - line: 10 errormsg: "'x' is not the first parameter; context: 'x.field[0]'" + line: 10 """ type diff --git a/tests/varstmt/tvardecl.nim b/tests/varstmt/tvardecl.nim index a6b508295..664de7134 100644 --- a/tests/varstmt/tvardecl.nim +++ b/tests/varstmt/tvardecl.nim @@ -1,5 +1,4 @@ discard """ - file: "tvardecl.nim" output: "44" """ # Test the new variable declaration syntax @@ -11,5 +10,3 @@ var write(stdout, a) write(stdout, b) #OUT 44 - - diff --git a/tests/vm/t2574.nim b/tests/vm/t2574.nim index 86602aeaf..4332667b4 100644 --- a/tests/vm/t2574.nim +++ b/tests/vm/t2574.nim @@ -1,6 +1,6 @@ discard """ - line: 14 errormsg: "cannot call method eval at compile time" + line: 14 """ type diff --git a/tests/vm/tcastint.nim b/tests/vm/tcastint.nim index f9d42fc54..437342a74 100644 --- a/tests/vm/tcastint.nim +++ b/tests/vm/tcastint.nim @@ -1,5 +1,4 @@ discard """ - file: "tcastint.nim" output: "OK" """ @@ -130,7 +129,7 @@ proc test_float_cast = doAssert(mantissa == 0, $mantissa) # construct 2^N float, where N is integer - let x = -2'i64 + let x = -2'i64 let xx = (x + exp_bias) shl exp_shift let xf = cast[float](xx) doAssert(xf == 0.25, $xf) @@ -151,7 +150,7 @@ proc test_float32_cast = doAssert(mantissa == 0, $mantissa) # construct 2^N float32 where N is integer - let x = 4'i32 + let x = 4'i32 let xx = (x + exp_bias) shl exp_shift let xf = cast[float32](xx) doAssert(xf == 16.0'f32, $xf) |