#!perl -w
use strict;
-use Test::More tests => 287;
+use Test::More tests => 288;
use Imager::Test qw(is_image);
# for SEEK_SET etc, Fcntl doesn't provide these in 5.005_03
use IO::Seekable;
my $data2 = Imager::io_slurp($IO5);
undef($IO5);
-ok($data2, "check we got data from bufchain");
+ok(defined $data2, "check we got data from bufchain");
+ok(length $data2, "check it's non-zero length");
my $IO6 = Imager::io_new_buffer($data2);
my $im3 = Imager::i_readpnm_wiol($IO6, -1)
or diag("failed to read from buffer: " . Imager->_error_as_msg);
-is(Imager::i_img_diff($im, $im3), 0, "read from buffer");
+unless ($im3) {
+ # getting a strange failure on some CPAN testers
+ print STDERR join(" ", map sprintf("%02x", ord), split //, substr($data2, 0, 30)), "\n";
+}
+
+SKIP: {
+ $im or skip "no \$im", 1;
+ $im3 or skip "no \$im3", 1;
+ is(Imager::i_img_diff($im, $im3), 0, "read from buffer");
+}
my $work = $data;
my $pos = 0;