summary refs log tree commit diff stats
path: root/tests/system
diff options
context:
space:
mode:
authorMichał Zieliński <michal@zielinscy.org.pl>2013-12-10 19:10:06 +0100
committerMichał Zieliński <michal@zielinscy.org.pl>2013-12-10 19:10:06 +0100
commit896766ae2c395a1fac7de75a61f09f3db5822985 (patch)
tree4cf0c13e2780ba95eeb2b48d164007cd54d21473 /tests/system
parentb4716e3b5b2cb43bd0a3468e391b4b4619eaabb5 (diff)
downloadNim-896766ae2c395a1fac7de75a61f09f3db5822985.tar.gz
Fix : and = precedence in parseopt.
Diffstat (limited to 'tests/system')
-rw-r--r--tests/system/params.nim9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/system/params.nim b/tests/system/params.nim
index 1e8385dc8..0ea099daa 100644
--- a/tests/system/params.nim
+++ b/tests/system/params.nim
@@ -7,11 +7,12 @@ let argv = commandLineParams()
 
 if argv == @[]:
   # this won't work with spaces
-  assert execShellCmd(getAppFilename() & " \"foo bar\" --aa:bar --ab -c --a[baz]:doo") == 0
+  assert execShellCmd(getAppFilename() & " \"foo bar\" --aa:bar=a --a=c:d --ab -c --a[baz]:doo") == 0
 else:
   let f = toSeq(getopt())
   echo f.repr
   assert f[0].kind == cmdArgument and f[0].key == "foo bar" and f[0].val == ""
-  assert f[1].kind == cmdLongOption and f[1].key == "aa" and f[1].val == "bar"
-  assert f[2].kind == cmdLongOption and f[2].key == "ab" and f[2].val == ""
-  assert f[3].kind == cmdShortOption and f[3].key == "c" and f[3].val == ""
+  assert f[1].kind == cmdLongOption and f[1].key == "aa" and f[1].val == "bar=a"
+  assert f[2].kind == cmdLongOption and f[2].key == "a=c" and f[2].val == "d"
+  assert f[3].kind == cmdLongOption and f[3].key == "ab" and f[3].val == ""
+  assert f[4].kind == cmdShortOption and f[4].key == "c" and f[4].val == ""