Skip to content

Commit

Permalink
tests: Print to stderr when test fails
Browse files Browse the repository at this point in the history
  • Loading branch information
bootandy committed Jan 29, 2024
1 parent 10168e0 commit 9606851
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/test_exact_output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ fn exact_output_test<T: AsRef<OsStr>>(valid_outputs: Vec<String>, command_args:

let output = str::from_utf8(&a.unwrap().stdout).unwrap().to_owned();

assert!(valid_outputs.iter().any(|i| output.contains(i)));
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());
}
assert!(will_fail)
}

// "windows" result data can vary by host (size seems to be variable by one byte); fix code vs test and re-enable
Expand Down

0 comments on commit 9606851

Please sign in to comment.