Add test for issue #95178
This commit is contained in:
parent
23320a2f83
commit
9270ca193f
1 changed files with 21 additions and 0 deletions
|
@ -435,3 +435,24 @@ fn run_bat_script() {
|
|||
assert!(output.status.success());
|
||||
assert_eq!(String::from_utf8_lossy(&output.stdout).trim(), "Hello, fellow Rustaceans!");
|
||||
}
|
||||
|
||||
// See issue #95178
|
||||
#[test]
|
||||
#[cfg(windows)]
|
||||
fn run_canonical_bat_script() {
|
||||
let tempdir = crate::sys_common::io::test::tmpdir();
|
||||
let script_path = tempdir.join("hello.cmd");
|
||||
|
||||
crate::fs::write(&script_path, "@echo Hello, %~1!").unwrap();
|
||||
|
||||
// Try using a canonical path
|
||||
let output = Command::new(&script_path.canonicalize().unwrap())
|
||||
.arg("fellow Rustaceans")
|
||||
.stdout(crate::process::Stdio::piped())
|
||||
.spawn()
|
||||
.unwrap()
|
||||
.wait_with_output()
|
||||
.unwrap();
|
||||
assert!(output.status.success());
|
||||
assert_eq!(String::from_utf8_lossy(&output.stdout).trim(), "Hello, fellow Rustaceans!");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue