From 37c6f3d08545c579409a52b2d7dd497e67d4d477 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Fri, 29 Sep 2023 20:02:53 -0500 Subject: [PATCH] fix(test): Add back in newlines to diffs Errors like this aren't too helpful ``` error: stderr did not match: 1 1 error: failed to parse manifest at `[..]`2 2 3 3 Caused by:4 4 TOML parse error at line 3, column 275 5 |6 6 3 | version = 17 7 | ^8 - invalid type: integer `1`, expected SemVer version 8 + invalid type: integer `1`, expected a string or workspace ``` This was broken in #12581 --- crates/cargo-test-support/src/diff.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/cargo-test-support/src/diff.rs b/crates/cargo-test-support/src/diff.rs index 3fedc839bf1..cd0c9738553 100644 --- a/crates/cargo-test-support/src/diff.rs +++ b/crates/cargo-test-support/src/diff.rs @@ -132,7 +132,7 @@ pub fn render_colored_changes(changes: &[Change]) -> String Change::Remove(i, s) => (format!("{:<4} ", i), '-', red, s), Change::Keep(x, y, s) => (format!("{:<4}{:<4} ", x, y), ' ', dim, s), }; - write!( + writeln!( buffer, "{dim}{nums}{reset}{bold}{sign}{reset}{color}{text}{reset}" )