Skip to content

Commit 21de27c

Browse files
committed
Explicitly mark the end of a failed test's captured output
1 parent 269d5b5 commit 21de27c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/bootstrap/src/utils/render_tests.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,14 @@ impl<'a> Renderer<'a> {
250250
if failure.stdout.is_some() || failure.message.is_some() {
251251
println!("---- {} stdout ----", failure.name);
252252
if let Some(stdout) = &failure.stdout {
253-
println!("{stdout}");
253+
// Captured test output normally ends with a newline,
254+
// so only use `println!` if it doesn't.
255+
print!("{stdout}");
256+
if !stdout.ends_with('\n') {
257+
println!("\n\\ (no newline at end of output)");
258+
}
254259
}
260+
println!("---- {} stdout end ----", failure.name);
255261
if let Some(message) = &failure.message {
256262
println!("NOTE: {message}");
257263
}

0 commit comments

Comments
 (0)