From 3b5bc86786a56b9437d1e6ac5a3de786110d731e Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Tue, 7 Oct 2014 15:58:36 -0400 Subject: implement P5 --- t/P5.t | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 t/P5.t (limited to 't/P5.t') diff --git a/t/P5.t b/t/P5.t new file mode 100644 index 0000000..bbd0cbf --- /dev/null +++ b/t/P5.t @@ -0,0 +1,70 @@ +#!/usr/bin/env perl +use strict; +use warnings; +use Test::More; + +use Image::PNM; + +my $image = Image::PNM->new('t/data/P5.pgm'); + +is($image->width, 6); +is($image->height, 8); +is($image->max_pixel_value, 255); +is_deeply($image->raw_pixel(1, 2), [78, 78, 78]); +is_deeply($image->pixel(0, 0), [1, 1, 1]); + +is($image->as_string('P1'), <as_string('P2'), <as_string('P3'), <as_string('P4') . "\n", <as_string('P5') . "\n", <