diff options
Diffstat (limited to 'tests/misc/trunner.nim')
-rw-r--r-- | tests/misc/trunner.nim | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/tests/misc/trunner.nim b/tests/misc/trunner.nim index 7fb437ce3..6e5487d1b 100644 --- a/tests/misc/trunner.nim +++ b/tests/misc/trunner.nim @@ -224,13 +224,15 @@ sub/mmain.idx""", context doAssert exitCode == 0, msg let data = parseJson(readFile(output))["entries"] - doAssert data.len == 4 + doAssert data.len == 5 let doSomething = data[0] doAssert doSomething["name"].getStr == "doSomething" doAssert doSomething["type"].getStr == "skProc" doAssert doSomething["line"].getInt == 1 doAssert doSomething["col"].getInt == 0 doAssert doSomething["code"].getStr == "proc doSomething(x, y: int): int {.raises: [], tags: [], forbids: [].}" + let foo2 = data[4] + doAssert $foo2["signature"] == """{"arguments":[{"name":"x","type":"T"},{"name":"y","type":"U"},{"name":"z","type":"M"}],"genericParams":[{"name":"T","types":"int"},{"name":"M","types":"string"},{"name":"U"}]}""" block: # nim jsondoc # bug #11953 let file = testsDir / "misc/mjsondoc.nim" @@ -241,7 +243,7 @@ sub/mmain.idx""", context doAssert exitCode == 0, msg let data = parseJson(readFile(destDir / "mjsondoc.json"))["entries"] - doAssert data.len == 4 + doAssert data.len == 5 let doSomething = data[0] doAssert doSomething["name"].getStr == "doSomething" doAssert doSomething["type"].getStr == "skProc" @@ -271,10 +273,13 @@ sub/mmain.idx""", context check execCmdEx(cmd) == ("12\n", 0) block: # bug #15316 - let file = testsDir / "misc/m15316.nim" - let cmd = fmt"{nim} check --hints:off --nimcache:{nimcache} {file}" - check execCmdEx(cmd) == ("m15316.nim(1, 15) Error: expression expected, but found \')\'\nm15316.nim(2, 1) Error: expected: \':\', but got: \'[EOF]\'\nm15316.nim(2, 1) Error: expression expected, but found \'[EOF]\'\nm15316.nim(2, 1) " & - "Error: expected: \')\', but got: \'[EOF]\'\nError: illformed AST: \n", 1) + when not defined(windows): + # This never worked reliably on Windows. Needs further investigation but it is hard to reproduce. + # Looks like a mild stack corruption when bailing out of nested exception handling. + let file = testsDir / "misc/m15316.nim" + let cmd = fmt"{nim} check --hints:off --nimcache:{nimcache} {file}" + check execCmdEx(cmd) == ("m15316.nim(1, 15) Error: expression expected, but found \')\'\nm15316.nim(2, 1) Error: expected: \':\', but got: \'[EOF]\'\nm15316.nim(2, 1) Error: expression expected, but found \'[EOF]\'\nm15316.nim(2, 1) " & + "Error: expected: \')\', but got: \'[EOF]\'\nError: illformed AST: \n", 1) block: # config.nims, nim.cfg, hintConf, bug #16557 @@ -342,8 +347,8 @@ tests/newconfig/bar/mfoo.nims""".splitLines when not defined(windows): check3 lines.len == 5 check3 lines[0].isDots - check3 lines[1].dup(removePrefix(">>> ")) == "3" # prompt depends on `nimUseLinenoise` - check3 lines[2].isDots + # check3 lines[1].isDots # todo nim secret might use parsing pipeline + check3 lines[2].dup(removePrefix(">>> ")) == "3" # prompt depends on `nimUseLinenoise` check3 lines[3] == "ab" check3 lines[4] == "" else: @@ -404,7 +409,7 @@ running: v2 block: # UnusedImport proc fn(opt: string, expected: string) = - let output = runNimCmdChk("pragmas/mused3.nim", fmt"--warning:all:off --warning:UnusedImport --hint:DuplicateModuleImport {opt}") + let output = runNimCmdChk("msgs/mused3.nim", fmt"--warning:all:off --warning:UnusedImport --hint:DuplicateModuleImport {opt}") doAssert output == expected, opt & "\noutput:\n" & output & "expected:\n" & expected fn("-d:case1"): """ mused3.nim(13, 8) Warning: imported and not used: 'mused3b' [UnusedImport] @@ -434,7 +439,6 @@ mused3.nim(75, 10) Hint: duplicate import of 'mused3a'; previous import here: mu fn("-d:case2 --gc:refc"): """mfield_defect.nim(25, 15) field 'f2' is not accessible for type 'Foo' [discriminant declared in mfield_defect.nim(14, 8)] using 'kind = k3'""" fn("-d:case1 -b:js"): """mfield_defect.nim(25, 15) Error: field 'f2' is not accessible for type 'Foo' [discriminant declared in mfield_defect.nim(14, 8)] using 'kind = k3'""" fn("-d:case2 -b:js"): """field 'f2' is not accessible for type 'Foo' [discriminant declared in mfield_defect.nim(14, 8)] using 'kind = k3'""" - # 3 instead of k3, because of lack of RTTI - fn("-d:case2 --gc:arc"): """mfield_defect.nim(25, 15) field 'f2' is not accessible for type 'Foo' [discriminant declared in mfield_defect.nim(14, 8)] using 'kind = 3'""" + fn("-d:case2 --gc:arc"): """mfield_defect.nim(25, 15) field 'f2' is not accessible for type 'Foo' [discriminant declared in mfield_defect.nim(14, 8)] using 'kind = k3'""" else: discard # only during debugging, tests added here will run with `-d:nimTestsTrunnerDebugging` enabled |