Skip to content

Commit

Permalink
tests: fix test test_apparent_size
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bootandy committed Jan 29, 2024
1 parent 9606851 commit 7ee7442
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions tests/test_exact_output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
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)
}
Expand Down Expand Up @@ -202,12 +206,19 @@ pub fn test_apparent_size() {

fn apparent_size_output() -> Vec<String> {
// 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]
}

0 comments on commit 7ee7442

Please sign in to comment.