diff options
author | andri lim <jangko128@gmail.com> | 2017-07-14 21:28:39 +0700 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2017-07-14 16:28:39 +0200 |
commit | ca0155a45808aa047661cbcb3d31fef6f7088953 (patch) | |
tree | 4e931306dc99d51f504fbbb9424cae58b9d781eb /tests | |
parent | 8bdcade1a08306ccf17c719838a97427a43a112c (diff) | |
download | Nim-ca0155a45808aa047661cbcb3d31fef6f7088953.tar.gz |
fixes #6046 parsecfg failed to parse negative int (#6097)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/stdlib/tparsecfg.nim | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/stdlib/tparsecfg.nim b/tests/stdlib/tparsecfg.nim new file mode 100644 index 000000000..1c214e5d2 --- /dev/null +++ b/tests/stdlib/tparsecfg.nim @@ -0,0 +1,23 @@ +discard """ + output: '''OK''' +""" + +#bug #6046 +import parsecfg + +var config = newConfig() +config.setSectionKey("foo","bar","-1") +config.setSectionKey("foo","foo","abc") +config.writeConfig("test.ini") + +# test.ini now contains +# [foo] +# bar=-1 +# foo=abc + +var config2 = loadConfig("test.ini") +let bar = config2.getSectionValue("foo","bar") +let foo = config2.getSectionValue("foo","foo") +assert(bar == "-1") +assert(foo == "abc") +echo "OK" |