diff options
author | Timothee Cour <timothee.cour2@gmail.com> | 2019-01-13 23:53:50 -0800 |
---|---|---|
committer | Timothee Cour <timothee.cour2@gmail.com> | 2019-01-14 17:00:54 -0800 |
commit | 9e68b2ce5d836fc269be9735d97aebb99adbfa2d (patch) | |
tree | 3145cf0e2db6a3823d1afdde3cb2d8d16d15ae24 /tests/misc | |
parent | 0a8762eb7b4b3c00cb78a40430f51080913a9ee6 (diff) | |
download | Nim-9e68b2ce5d836fc269be9735d97aebb99adbfa2d.tar.gz |
fix test
Diffstat (limited to 'tests/misc')
-rw-r--r-- | tests/misc/tparseopt.nim | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/tests/misc/tparseopt.nim b/tests/misc/tparseopt.nim index 39c17869c..57253389d 100644 --- a/tests/misc/tparseopt.nim +++ b/tests/misc/tparseopt.nim @@ -29,6 +29,7 @@ kind: cmdLongOption key:val -- left: kind: cmdLongOption key:val -- debug:3 kind: cmdShortOption key:val -- l:4 kind: cmdShortOption key:val -- r:2''' +joinable: false """ when defined(testament_tparseopt): @@ -98,12 +99,22 @@ else: block: # fix #9951 var p = parseopt.initOptParser(@["echo \"quoted\""]) - assertEquals parseopt.cmdLineRest(p), """'echo "quoted"'""" + let expected = when defined(windows): + """"echo \"quoted\""""" + else: + """'echo "quoted"'""" + assertEquals parseopt.cmdLineRest(p), expected + + doAssert "a5'b" == "a5\'b" + let args = @["a1b", "a2 b", "", "a4\"b", "a5'b", r"a6\b", "a7\'b"] var p2 = parseopt.initOptParser(args) - assertEquals parseopt.cmdLineRest(p2), + let expected2 = when defined(windows): + """a1b "a2 b" "" a4\"b a5'b a6\b a7'b""" + else: """a1b 'a2 b' '' 'a4"b' 'a5'"'"'b' 'a6\b' 'a7'"'"'b'""" doAssert "a5'b" == "a5\'b" + assertEquals parseopt.cmdLineRest(p2), expected2 block: # fix #9842 let exe = buildDir / "D20190112T145450".addFileExt(ExeExt) |