mirror of
https://github.com/bootandy/dust.git
synced 2026-06-08 11:29:05 +03:00
Add test to check number of files flag
This commit is contained in:
@@ -368,3 +368,20 @@ pub fn test_hidden_flag() {
|
|||||||
let output = str::from_utf8(&output).unwrap();
|
let output = str::from_utf8(&output).unwrap();
|
||||||
assert!(!output.contains(".hidden_file"));
|
assert!(!output.contains(".hidden_file"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
pub fn test_number_of_files() {
|
||||||
|
// Check we can see the hidden file normally
|
||||||
|
let mut cmd = Command::cargo_bin("dust").unwrap();
|
||||||
|
let output = cmd
|
||||||
|
.arg("-c")
|
||||||
|
.arg("-f")
|
||||||
|
.arg("tests/test_dir")
|
||||||
|
.unwrap()
|
||||||
|
.stdout;
|
||||||
|
let output = str::from_utf8(&output).unwrap();
|
||||||
|
assert!(output.contains("1 ┌── hello_file"));
|
||||||
|
assert!(output.contains("1 ├── a_file "));
|
||||||
|
assert!(output.contains("3 ┌─┴ many"));
|
||||||
|
assert!(output.contains("4 ┌─┴ test_dir"));
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user