diff --git a/src/diffs.rs b/src/diffs.rs index 64fc8902d..e1ceb012a 100644 --- a/src/diffs.rs +++ b/src/diffs.rs @@ -106,10 +106,19 @@ fn apply_color_by_line(s: &str, ranges: &[LineRange], c: Color) -> String { res.push_str(line); } } + res.push_str("\n"); } res } +#[test] +fn apply_color_by_line_no_positions() { + assert_eq!( + apply_color_by_line("foo\nbar\n", &vec![], Color::Black), + "foo\nbar\n" + ); +} + #[test] fn apply_color_no_positions() { assert_eq!(apply_color("foobar", &vec![], Color::Black), "foobar");