use std::process::ExitCode;
fn main() -> ExitCode {
match test_better_snapshot::apply_pending_patches() {
Ok(applied) if applied.is_empty() => {
println!("test-better-accept: no pending inline-snapshot patches");
ExitCode::SUCCESS
}
Ok(applied) => {
let total: usize = applied.iter().map(|file| file.patches).sum();
println!(
"test-better-accept: applied {total} patch(es) across {} file(s):",
applied.len()
);
for file in &applied {
println!(" {} ({} patch(es))", file.file.display(), file.patches);
}
ExitCode::SUCCESS
}
Err(error) => {
eprintln!("test-better-accept: {error}");
ExitCode::FAILURE
}
}
}