mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 23:34:48 +00:00
24 lines
444 B
Rust
24 lines
444 B
Rust
//@ run-pass
|
|
//@ ignore-emscripten no processes
|
|
//@ ignore-sgx no processes
|
|
|
|
use std::process::Command;
|
|
use std::env;
|
|
|
|
fn main() {
|
|
let len = env::args().len();
|
|
|
|
if len == 1 {
|
|
test();
|
|
} else {
|
|
assert_eq!(len, 3);
|
|
}
|
|
}
|
|
|
|
fn test() {
|
|
let status = Command::new(&env::current_exe().unwrap())
|
|
.arg("foo").arg("")
|
|
.status().unwrap();
|
|
assert!(status.success());
|
|
}
|