From c58bbc3a8368dc96f1a07e2ee3bf0825c9e2af34 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Tue, 7 Oct 2014 15:43:18 -0400 Subject: implement P4 --- t/P1.t | 6 ++++++ t/P2.t | 6 ++++++ t/P3.t | 6 ++++++ t/P4.t | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ t/data/P4.pbm | Bin 0 -> 54 bytes 5 files changed, 81 insertions(+) create mode 100644 t/P4.t create mode 100644 t/data/P4.pbm (limited to 't') diff --git a/t/P1.t b/t/P1.t index 9e0bf14..030634b 100644 --- a/t/P1.t +++ b/t/P1.t @@ -54,4 +54,10 @@ P3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 IMAGE +is($image->as_string('P4') . "\n", <as_string('P4') . "\n", <as_string('P4') . "\n", <new('t/data/P4.pbm'); + +is($image->width, 6); +is($image->height, 8); +is($image->max_pixel_value, 1); +is_deeply($image->raw_pixel(1, 2), [0, 0, 0]); +is_deeply($image->pixel(4, 1), [0, 0, 0]); + +is($image->as_string('P1'), <as_string('P2'), <as_string('P3'), <as_string('P4') . "\n", <