Skip to content

Commit

Permalink
fix(test): Add back in newlines to diffs
Browse files Browse the repository at this point in the history
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 rust-lang#12581
  • Loading branch information
epage committed Sep 30, 2023
1 parent 59596f0 commit 37c6f3d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/cargo-test-support/src/diff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ pub fn render_colored_changes<T: fmt::Display>(changes: &[Change<T>]) -> 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}"
)
Expand Down

0 comments on commit 37c6f3d

Please sign in to comment.