Tests: Move test apparent size to exact_output

Because apparent_size uses the test files created in /tmp it needs to be
in the test_exact_output where those files are copied. Otherwise the files
may not be there when the test is run.
This commit is contained in:
andy.boot
2021-10-24 10:36:34 +01:00
parent fa4405b58b
commit 4b3dc3988d
2 changed files with 41 additions and 18 deletions
+19
View File
@@ -192,3 +192,22 @@ fn unicode_dir() -> Vec<String> {
.into();
vec![mac_and_some_linux, ubuntu]
}
#[cfg_attr(target_os = "windows", ignore)]
#[test]
pub fn test_apparent_size() {
let command_args = vec!["-c", "-s", "-b", "/tmp/test_dir"];
exact_output_test(apparent_size_output(), command_args);
}
fn apparent_size_output() -> Vec<String> {
// The apparent directory sizes are too unpredictable and system dependant to try and match
let files = r#"
0B ┌── a_file
6B ├── hello_file
"#
.trim()
.to_string();
vec![files]
}