Skip to content

Commit 07f54d9

Browse files
committed
Use "rustc" for testing Command args
"echo" is not an application on Windows so `Command` tests could fail even if that's not what's being tested for.
1 parent 2b643e9 commit 07f54d9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

library/std/src/process/tests.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -297,23 +297,23 @@ fn test_interior_nul_in_progname_is_error() {
297297

298298
#[test]
299299
fn test_interior_nul_in_arg_is_error() {
300-
match Command::new("echo").arg("has-some-\0\0s-inside").spawn() {
300+
match Command::new("rustc").arg("has-some-\0\0s-inside").spawn() {
301301
Err(e) => assert_eq!(e.kind(), ErrorKind::InvalidInput),
302302
Ok(_) => panic!(),
303303
}
304304
}
305305

306306
#[test]
307307
fn test_interior_nul_in_args_is_error() {
308-
match Command::new("echo").args(&["has-some-\0\0s-inside"]).spawn() {
308+
match Command::new("rustc").args(&["has-some-\0\0s-inside"]).spawn() {
309309
Err(e) => assert_eq!(e.kind(), ErrorKind::InvalidInput),
310310
Ok(_) => panic!(),
311311
}
312312
}
313313

314314
#[test]
315315
fn test_interior_nul_in_current_dir_is_error() {
316-
match Command::new("echo").current_dir("has-some-\0\0s-inside").spawn() {
316+
match Command::new("rustc").current_dir("has-some-\0\0s-inside").spawn() {
317317
Err(e) => assert_eq!(e.kind(), ErrorKind::InvalidInput),
318318
Ok(_) => panic!(),
319319
}

0 commit comments

Comments
 (0)