]> git.imager.perl.org - imager.git/blob - t/t101nojpeg.t
[rt.cpan.org #65385] Patch for Imager::Color->hsv
[imager.git] / t / t101nojpeg.t
1 #!perl -w
2 use strict;
3 use Test::More;
4 use Imager qw(:all);
5
6 init_log("testout/t101jpeg.log",1);
7
8 $Imager::formats{"jpeg"}
9   and plan skip_all => "have jpeg support - this tests the lack of it";
10
11 plan tests => 6;
12
13 my $im = Imager->new;
14 ok(!$im->read(file=>"testimg/base.jpg"), "should fail to read jpeg");
15 cmp_ok($im->errstr, '=~', qr/format 'jpeg' not supported/, "check no jpeg message");
16 $im = Imager->new(xsize=>2, ysize=>2);
17 ok(!$im->write(file=>"testout/nojpeg.jpg"), "should fail to write jpeg");
18 cmp_ok($im->errstr, '=~', qr/format 'jpeg' not supported/, "check no jpeg message");
19 ok(!grep($_ eq 'jpeg', Imager->read_types), "check jpeg not in read types");
20 ok(!grep($_ eq 'jpeg', Imager->write_types), "check jpeg not in write types");