Skip to content
Newer
Older
100644 37 lines (27 sloc) 1.2 KB
e83b349 separate tiff and no tiff tests
Tony Cook authored Sep 5, 2009
1 #!perl -w
2 use strict;
3 use Test::More;
4 use Imager qw(:all);
5
e5ee047 move TIFF into its own module
Tony Cook authored Aug 25, 2010
6 $Imager::formats{"tiff"}
e83b349 separate tiff and no tiff tests
Tony Cook authored Sep 5, 2009
7 and plan skip_all => "tiff support available - this tests the lack of it";
8
8d46e5d handle missing libraries in read_multi()
Tony Cook authored Apr 2, 2010
9 plan tests => 12;
e83b349 separate tiff and no tiff tests
Tony Cook authored Sep 5, 2009
10
11 my $im = Imager->new;
8d46e5d handle missing libraries in read_multi()
Tony Cook authored Apr 2, 2010
12
e85532b use test files that exist
Tony Cook authored Sep 16, 2010
13 ok(!$im->read(file=>"TIFF/testimg/comp4.tif"), "should fail to read tif");
8d46e5d handle missing libraries in read_multi()
Tony Cook authored Apr 2, 2010
14 cmp_ok($im->errstr, '=~', "format 'tiff' not supported",
15 "check no tiff message");
16
e85532b use test files that exist
Tony Cook authored Sep 16, 2010
17 ok(!$im->read_multi(file => "TIFF/testimg/comp4.tif"),
8d46e5d handle missing libraries in read_multi()
Tony Cook authored Apr 2, 2010
18 "should fail to read multi tiff");
19 cmp_ok($im->errstr, '=~', "format 'tiff' not supported",
20 "check no tiff message");
21
e83b349 separate tiff and no tiff tests
Tony Cook authored Sep 5, 2009
22 $im = Imager->new(xsize=>2, ysize=>2);
8d46e5d handle missing libraries in read_multi()
Tony Cook authored Apr 2, 2010
23
e83b349 separate tiff and no tiff tests
Tony Cook authored Sep 5, 2009
24 ok(!$im->write(file=>"testout/notiff.tif"), "should fail to write tiff");
8d46e5d handle missing libraries in read_multi()
Tony Cook authored Apr 2, 2010
25 cmp_ok($im->errstr, '=~', "format 'tiff' not supported",
26 "check no tiff message");
27 ok(!-e "testout/notiff.tif", "file shouldn't be created");
28
29 ok(!Imager->write_multi({file=>"testout/notiff.tif"}, $im, $im),
30 "should fail to write multi tiff");
31 cmp_ok($im->errstr, '=~', "format 'tiff' not supported",
32 "check no tiff message");
33 ok(!-e "testout/notiff.tif", "file shouldn't be created");
34
e83b349 separate tiff and no tiff tests
Tony Cook authored Sep 5, 2009
35 ok(!grep($_ eq 'tiff', Imager->read_types), "check tiff not in read types");
36 ok(!grep($_ eq 'tiff', Imager->write_types), "check tiff not in write types");
Something went wrong with that request. Please try again.