Skip to content

Commit 405de02

Browse files
committed
some more Windows argument passing tests
1 parent 76057dc commit 405de02

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

src/eval.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -443,8 +443,8 @@ mod tests {
443443
fn windows_argv0_no_escape() {
444444
// Ensure that a trailing backslash in argv[0] is not escaped.
445445
let cmd = String::from_utf16_lossy(&args_to_utf16_command_string(
446-
[r"C:\Program Files\", "arg1"].iter(),
446+
[r"C:\Program Files\", "arg1", "arg 2", "arg \" 3"].iter(),
447447
));
448-
assert_eq!(cmd.trim_end_matches("\0"), r#""C:\Program Files\" arg1"#);
448+
assert_eq!(cmd.trim_end_matches("\0"), r#""C:\Program Files\" arg1 "arg 2" "arg \" 3""#);
449449
}
450450
}

test-cargo-miri/run-test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def test_cargo_miri_run():
9494
# so keep it set
9595
)
9696
test("`cargo miri run` (with arguments and target)",
97-
cargo_miri("run") + ["--bin", "cargo-miri-test", "--", "hello world", '"hello world"'],
97+
cargo_miri("run") + ["--bin", "cargo-miri-test", "--", "hello world", '"hello world"', r'he\\llo\"world'],
9898
"run.args.stdout.ref", "run.args.stderr.ref",
9999
)
100100
test("`cargo miri r` (subcrate, no isolation)",

test-cargo-miri/run.args.stderr.ref

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
main
22
hello world
33
"hello world"
4+
he\\llo\"world

0 commit comments

Comments
 (0)