]> git.imager.perl.org - imager.git/blob - t/t102nopng.t
[rt #83212] avoid a possible bad optimizer on centos 5.9
[imager.git] / t / t102nopng.t
1 #!perl -w
2 use strict;
3 use Imager qw(:all);
4 use Test::More;
5
6 $Imager::formats{"png"}
7   and plan skip_all => "png available, and this tests the lack of it";
8
9 plan tests => 6;
10
11 my $im = Imager->new;
12 ok(!$im->read(file=>"testimg/test.png"), "should fail to read png");
13 cmp_ok($im->errstr, '=~', "format 'png' not supported", "check no png message");
14 $im = Imager->new(xsize=>2, ysize=>2);
15 ok(!$im->write(file=>"testout/nopng.png"), "should fail to write png");
16 cmp_ok($im->errstr, '=~', "format 'png' not supported", "check no png message");
17 ok(!grep($_ eq 'png', Imager->read_types), "check png not in read types");
18 ok(!grep($_ eq 'png', Imager->write_types), "check png not in write types");
19