mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
Add initial test for pwd.
This commit is contained in:
@@ -170,6 +170,7 @@ TEST_PROGS := \
|
||||
mv \
|
||||
nl \
|
||||
paste \
|
||||
pwd \
|
||||
seq \
|
||||
sort \
|
||||
test \
|
||||
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
use std::env;
|
||||
use std::process::Command;
|
||||
use std::str;
|
||||
|
||||
static PROGNAME: &'static str = "./pwd";
|
||||
|
||||
#[test]
|
||||
fn test_default() {
|
||||
let po = Command::new(PROGNAME)
|
||||
.output()
|
||||
.unwrap_or_else(|err| panic!("{}", err));
|
||||
|
||||
let out = str::from_utf8(&po.stdout[..]).unwrap().trim_right();
|
||||
let expected = env::current_dir().unwrap().into_os_string().into_string().unwrap();
|
||||
assert_eq!(out, expected);
|
||||
}
|
||||
Reference in New Issue
Block a user