Tests: check the empty image's length before its pixels

The test-lint step flagged the all() check on the fallback image as
unguarded: an empty pixel list would pass it. The test now asserts the
image holds one pixel per position of its 3 x 2 size first.
This commit is contained in:
dotCooCoo committed 2026-12-04 09:08:56 -08:00
1 parent deb403f6fa
commit 2e44f9b2e8
1 file changed
+1
+1
View File
@@ -6980,5 +6980,6 @@ fn the_worker_s_frame_reaches_its_texture_image_in_the_buffer_it_was_rendered_in
// A raster whose pixels don't match its size gives an empty image of that size.
let short = vectorcraft_render::Rendered { width: 3, height: 2, pixels: vec![u32::MAX; 5] };
let empty = color_image_owned(short);
assert_eq!(empty.pixels.len(), 6, "the empty image has one pixel per position of its size");
assert!(empty.size == [3, 2] && empty.pixels.iter().all(|c| *c == Color32::TRANSPARENT), "a raster of the wrong length is not shown");
}