tests: fix test test_apparent_size

my 'many' line is: 4.0K   ┌─┴ many        │ the characters 4.0K are 4 chars.

photosheep's space for 'many' is '44B' which is 3 chars and so my system
needs 1 more char. Hence there is one more space character padding
floating round.
This commit is contained in:
andy.boot
2024-01-29 22:17:16 +00:00
parent 96068518f6
commit 7ee744207b
+14 -3
View File
@@ -54,7 +54,11 @@ fn exact_output_test<T: AsRef<OsStr>>(valid_outputs: Vec<String>, command_args:
let will_fail = valid_outputs.iter().any(|i| output.contains(i)); let will_fail = valid_outputs.iter().any(|i| output.contains(i));
if !will_fail { if !will_fail {
eprintln!("output:\n{}\ndoes not contain any of:\n{:?}",output, valid_outputs.iter()); eprintln!(
"output:\n{}\ndoes not contain any of:\n{}",
output,
valid_outputs.join("\n\n")
);
} }
assert!(will_fail) assert!(will_fail)
} }
@@ -202,12 +206,19 @@ pub fn test_apparent_size() {
fn apparent_size_output() -> Vec<String> { fn apparent_size_output() -> Vec<String> {
// The apparent directory sizes are too unpredictable and system dependent to try and match // The apparent directory sizes are too unpredictable and system dependent to try and match
let files = r#" let one_space_before = r#"
0B ┌── a_file
6B ├── hello_file
"#
.trim()
.to_string();
let two_space_before = r#"
0B ┌── a_file 0B ┌── a_file
6B ├── hello_file 6B ├── hello_file
"# "#
.trim() .trim()
.to_string(); .to_string();
vec![files] vec![one_space_before, two_space_before]
} }