assert new line at end of ppm
This commit is contained in:
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user