Add test to check number of files flag

This commit is contained in:
andy.boot
2020-09-02 23:05:57 +01:00
parent 8e8f18b9bc
commit 695c9b6747
+17
View File
@@ -368,3 +368,20 @@ pub fn test_hidden_flag() {
let output = str::from_utf8(&output).unwrap();
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"));
}