summaryrefslogtreecommitdiffstats
path: root/src/test/ui/command/command-argv0-debug.rs
blob: 4aba1229f29a822f29995579a8b0ef84822cb4be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// run-pass

// ignore-windows - this is a unix-specific test
// ignore-emscripten no processes
// ignore-sgx no processes
use std::os::unix::process::CommandExt;
use std::process::Command;

fn main() {
    let mut command = Command::new("some-boring-name");

    assert_eq!(format!("{:?}", command), r#""some-boring-name""#);

    command.args(&["1", "2", "3"]);

    assert_eq!(format!("{:?}", command), r#""some-boring-name" "1" "2" "3""#);

    command.arg0("exciting-name");

    assert_eq!(format!("{:?}", command), r#"["some-boring-name"] "exciting-name" "1" "2" "3""#);
}