closes #15316; add testcase (#20213)

This commit is contained in:
ringabout
2022-08-13 22:23:11 +08:00
committed by GitHub
parent 713f39083e
commit d2318d9ccf
2 changed files with 7 additions and 0 deletions

1
tests/misc/m15316.nim Normal file
View File

@@ -0,0 +1 @@
proc foo = (if)

View File

@@ -249,6 +249,12 @@ sub/mmain.idx""", context
let cmd = fmt"{nim} r -b:cpp --hints:off --nimcache:{nimcache} --warningAsError:ProveInit {file}"
check execCmdEx(cmd) == ("witness\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)
block: # config.nims, nim.cfg, hintConf, bug #16557
let cmd = fmt"{nim} r --hint:all:off --hint:conf tests/newconfig/bar/mfoo.nim"
let (outp, exitCode) = execCmdEx(cmd, options = {poStdErrToStdOut})