mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-29 12:07:46 +00:00
Add initial test for pwd.
This commit is contained in:
parent
9172bb9bd8
commit
08aea6d549
2 changed files with 17 additions and 0 deletions
1
Makefile
1
Makefile
|
@ -170,6 +170,7 @@ TEST_PROGS := \
|
||||||
mv \
|
mv \
|
||||||
nl \
|
nl \
|
||||||
paste \
|
paste \
|
||||||
|
pwd \
|
||||||
seq \
|
seq \
|
||||||
sort \
|
sort \
|
||||||
test \
|
test \
|
||||||
|
|
16
test/pwd.rs
Normal file
16
test/pwd.rs
Normal file
|
@ -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);
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue