2 // ignore-cloudabi no processes
3 // ignore-emscripten no processes
4 // ignore-sgx no processes
7 use std::process::Command;
9 fn assert_reverse_iterator_for_program_arguments(program_name: &str) {
10 let args: Vec<_> = args().rev().collect();
12 assert!(args.len() == 4);
13 assert_eq!(args[0], "c");
14 assert_eq!(args[1], "b");
15 assert_eq!(args[2], "a");
16 assert_eq!(args[3], program_name);
22 let mut args = args();
23 let me = args.next().unwrap();
25 if let Some(_) = args.next() {
26 assert_reverse_iterator_for_program_arguments(&me);
30 let output = Command::new(&me)
36 assert!(output.status.success());
37 assert!(output.stderr.is_empty());
38 assert_eq!(output.stdout, b"passed\n");