some more Windows argument passing tests

This commit is contained in:
Ralf Jung 2021-09-24 10:13:29 -04:00
parent 76057dc518
commit 405de0217d
3 changed files with 4 additions and 3 deletions

View File

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

View File

@ -94,7 +94,7 @@ def test_cargo_miri_run():
# so keep it set
)
test("`cargo miri run` (with arguments and target)",
cargo_miri("run") + ["--bin", "cargo-miri-test", "--", "hello world", '"hello world"'],
cargo_miri("run") + ["--bin", "cargo-miri-test", "--", "hello world", '"hello world"', r'he\\llo\"world'],
"run.args.stdout.ref", "run.args.stderr.ref",
)
test("`cargo miri r` (subcrate, no isolation)",

View File

@ -1,3 +1,4 @@
main
hello world
"hello world"
he\\llo\"world