From 7ee744207b284cbf1486ff71422efa175dd21ae8 Mon Sep 17 00:00:00 2001 From: "andy.boot" Date: Mon, 29 Jan 2024 22:17:16 +0000 Subject: [PATCH] tests: fix test test_apparent_size MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- tests/test_exact_output.rs | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/tests/test_exact_output.rs b/tests/test_exact_output.rs index 1cc06f2..c2e7f88 100644 --- a/tests/test_exact_output.rs +++ b/tests/test_exact_output.rs @@ -54,7 +54,11 @@ fn exact_output_test>(valid_outputs: Vec, command_args: let will_fail = valid_outputs.iter().any(|i| output.contains(i)); 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) } @@ -202,12 +206,19 @@ pub fn test_apparent_size() { fn apparent_size_output() -> Vec { // 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 6B ├── hello_file "# .trim() .to_string(); - vec![files] + vec![one_space_before, two_space_before] }