core-utils 0.1.2

A reimplementation of the GNU core utils in the Rust programming language
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use std::process::Command;

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

#[test]
fn test_pwd() {
    let gnu_pwd = Command::new("pwd")
                        .output()
                        .unwrap();
    let prog = Command::new(PROG)
                        .output()
                        .unwrap_or_else(|e| { panic!("Failed to run test for pwd: {}", e) });
    assert_eq!(prog.status.success(), true);
    assert_eq!(String::from_utf8_lossy(&prog.stdout), String::from_utf8_lossy(&gnu_pwd.stdout));
}