Explicitly mark the end of a failed test's captured output

This commit is contained in:
Zalathar 2025-08-27 17:30:59 +10:00
parent 269d5b56bc
commit 21de27c88a

View file

@ -250,8 +250,14 @@ impl<'a> Renderer<'a> {
if failure.stdout.is_some() || failure.message.is_some() {
println!("---- {} stdout ----", failure.name);
if let Some(stdout) = &failure.stdout {
println!("{stdout}");
// Captured test output normally ends with a newline,
// so only use `println!` if it doesn't.
print!("{stdout}");
if !stdout.ends_with('\n') {
println!("\n\\ (no newline at end of output)");
}
}
println!("---- {} stdout end ----", failure.name);
if let Some(message) = &failure.message {
println!("NOTE: {message}");
}