From 695c9b67476cbe811007e4df7e2f5566b203c5c1 Mon Sep 17 00:00:00 2001 From: "andy.boot" Date: Wed, 2 Sep 2020 23:05:57 +0100 Subject: [PATCH] Add test to check number of files flag --- tests/tests.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/tests.rs b/tests/tests.rs index 7b703cc..1593811 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -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")); +}