From d2318d9ccfe69e21d0517f0448a6469a18b69513 Mon Sep 17 00:00:00 2001 From: ringabout <43030857+ringabout@users.noreply.github.com> Date: Sat, 13 Aug 2022 22:23:11 +0800 Subject: [PATCH] closes #15316; add testcase (#20213) --- tests/misc/m15316.nim | 1 + tests/misc/trunner.nim | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100644 tests/misc/m15316.nim diff --git a/tests/misc/m15316.nim b/tests/misc/m15316.nim new file mode 100644 index 000000000..188d06946 --- /dev/null +++ b/tests/misc/m15316.nim @@ -0,0 +1 @@ +proc foo = (if) diff --git a/tests/misc/trunner.nim b/tests/misc/trunner.nim index 67615cee9..bc2e872ef 100644 --- a/tests/misc/trunner.nim +++ b/tests/misc/trunner.nim @@ -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})