Skip to content

Commit

Permalink
Allow blessing test run for collapse too
Browse files Browse the repository at this point in the history
  • Loading branch information
jonhoo committed Jul 14, 2024
1 parent bd14b1f commit edaba3b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tests/common/collapse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,15 @@ where
eprintln!("test output in {}", tm.display());
}
// and then compare
compare_results(result, expected, expected_filename, strip_quotes);
if let Err(e) = std::panic::catch_unwind(|| {
compare_results(result.clone(), expected, expected_filename, strip_quotes)
}) {
if std::env::var("INFERNO_BLESS_TESTS").is_ok() {
fs::write(expected_filename, result.get_ref()).unwrap();
} else {
std::panic::resume_unwind(e);
}
}
Ok(())
}

Expand Down

0 comments on commit edaba3b

Please sign in to comment.