assert new line at end of ppm

This commit is contained in:
Jon Janzen
2021-03-05 17:32:47 -07:00
parent aa4e01d3f7
commit 842c93568b

View File

@@ -154,4 +154,11 @@ mod tests {
let four_to_seven = ppm.split("\n").skip(3).collect::<Vec<&str>>().join("\n");
assert_eq!(line4_7, four_to_seven);
}
#[test]
fn ends_with_newline() {
let c = Canvas::new(5, 3);
let mut ppm = c.to_ppm();
assert_eq!(Some('\n'), ppm.pop());
}
}