summary refs log tree commit diff stats
path: root/tests/misc/trunner.nim
diff options
context:
space:
mode:
authorTimothee Cour <timothee.cour2@gmail.com>2020-12-01 21:09:08 -0800
committerGitHub <noreply@github.com>2020-12-01 21:09:08 -0800
commit84f2ad3068cb77247ee6a263b2d375685b28b850 (patch)
tree011ed6da3ae59ae8fcbf5fac8bb5bb891302f0b7 /tests/misc/trunner.nim
parent9fa5826d62156c1f6fdc765403bea2d3a098c10e (diff)
downloadNim-84f2ad3068cb77247ee6a263b2d375685b28b850.tar.gz
add test for --eval; fix a minor bug (#16224)
Diffstat (limited to 'tests/misc/trunner.nim')
-rw-r--r--tests/misc/trunner.nim6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/misc/trunner.nim b/tests/misc/trunner.nim
index 018916e67..e288a56c7 100644
--- a/tests/misc/trunner.nim
+++ b/tests/misc/trunner.nim
@@ -216,3 +216,9 @@ mmain.html
     let file = testsDir / "misc/mimportc.nim"
     let cmd = fmt"{nim} r -b:cpp --hints:off --nimcache:{nimcache} --warningAsError:ProveInit {file}"
     check execCmdEx(cmd) == ("witness\n", 0)
+
+  block: # nim --eval
+    let opt = "--hints:off"
+    check fmt"""{nim} {opt} --eval:"echo defined(nimscript)"""".execCmdEx == ("true\n", 0)
+    check fmt"""{nim} r {opt} --eval:"echo defined(c)"""".execCmdEx == ("true\n", 0)
+    check fmt"""{nim} r -b:js {opt} --eval:"echo defined(js)"""".execCmdEx == ("true\n", 0)