File: 210-nopng.t

package info (click to toggle)
libimager-perl 1.019%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 6,824 kB
  • sloc: perl: 32,886; ansic: 28,193; makefile: 52; cpp: 4
file content (19 lines) | stat: -rw-r--r-- 691 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!perl -w
use strict;
use Imager qw(:all);
use Test::More;

$Imager::formats{"png"}
  and plan skip_all => "png available, and this tests the lack of it";

plan tests => 6;

my $im = Imager->new;
ok(!$im->read(file=>"testimg/test.png"), "should fail to read png");
cmp_ok($im->errstr, '=~', "format 'png' not supported", "check no png message");
$im = Imager->new(xsize=>2, ysize=>2);
ok(!$im->write(file=>"testout/nopng.png"), "should fail to write png");
cmp_ok($im->errstr, '=~', "format 'png' not supported", "check no png message");
ok(!grep($_ eq 'png', Imager->read_types), "check png not in read types");
ok(!grep($_ eq 'png', Imager->write_types), "check png not in write types");