]> git.lizzy.rs Git - rust.git/blob - src/test/ui/command/command-argv0-debug.rs
Move command-related tests into command/
[rust.git] / src / test / ui / command / command-argv0-debug.rs
1 // run-pass
2
3 // ignore-windows - this is a unix-specific test
4 // ignore-cloudabi no processes
5 // ignore-emscripten no processes
6 // ignore-sgx no processes
7 #![feature(process_set_argv0)]
8
9 use std::os::unix::process::CommandExt;
10 use std::process::Command;
11
12 fn main() {
13     let mut command = Command::new("some-boring-name");
14
15     assert_eq!(format!("{:?}", command), r#""some-boring-name""#);
16
17     command.args(&["1", "2", "3"]);
18
19     assert_eq!(format!("{:?}", command), r#""some-boring-name" "1" "2" "3""#);
20
21     command.arg0("exciting-name");
22
23     assert_eq!(format!("{:?}", command), r#"["some-boring-name"] "exciting-name" "1" "2" "3""#);
24 }