core-utils 0.1.2

A reimplementation of the GNU core utils in the Rust programming language
use std::process::Command;

static PROG: &'static str = "target/debug/nproc";

#[test]
#[should_panic]
fn test_nproc_bad_option() {
    let prog = Command::new(PROG)
                        .arg("--fail")
                        .output()
                        .unwrap_or_else(|e| { panic!("Failed to run test for nproc: {}", e) });
    assert_eq!(prog.status.success(), true);
    println!("{}", String::from_utf8_lossy(&prog.stdout));
}

#[test]
fn test_nproc_help() {
    let prog = Command::new(PROG)
                        .arg("--help")
                        .output()
                        .unwrap_or_else(|e| { panic!("Failed to run test for nproc: {}", e) });
    assert_eq!(prog.status.success(), true);
    println!("{}", String::from_utf8_lossy(&prog.stdout));
}

#[test]
fn test_nproc_ignore() {
    let prog = Command::new(PROG)
                        .arg("-i")
                        .arg("1")
                        .output()
                        .unwrap_or_else(|e| { panic!("Failed to run test for nproc: {}", e) });
    assert_eq!(prog.status.success(), true);
    println!("{}", String::from_utf8_lossy(&prog.stdout));
}