add tree test

This commit is contained in:
AJ ONeal 2020-12-10 23:54:00 -07:00 committed by Abin Simon
parent 1cdef5fe96
commit 760d5c7538

View file

@ -397,6 +397,20 @@ fn test_bad_utf_8_name() {
.stdout(predicate::str::is_match("bad-name\u{fffd}\u{fffd}.ext\n$").unwrap()); .stdout(predicate::str::is_match("bad-name\u{fffd}\u{fffd}.ext\n$").unwrap());
} }
#[test]
fn test_tree() {
let tmp = tempdir();
tmp.child("one").touch().unwrap();
tmp.child("one.d").create_dir_all().unwrap();
tmp.child("one.d/two").touch().unwrap();
cmd()
.arg(tmp.path())
.arg("--tree")
.assert()
.stdout(predicate::str::is_match("├── one\n└── one.d\n └── two\n$").unwrap());
}
#[test] #[test]
fn test_tree_d() { fn test_tree_d() {
let tmp = tempdir(); let tmp = tempdir();