diff --git a/src/bootstrap/src/utils/render_tests.rs b/src/bootstrap/src/utils/render_tests.rs index 40006aca5c53f..90fd57d976d3f 100644 --- a/src/bootstrap/src/utils/render_tests.rs +++ b/src/bootstrap/src/utils/render_tests.rs @@ -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}"); }