Here you go - tests for warnings, and a fix:
}
sub _get_y_tics {
- return $_[0]->{'y_tics'};
+ return $_[0]->{'y_tics'} || 0;
}
sub _remove_tics_from_chart_box {
++$|;
+my @warned;
+local $SIG{__WARN__} =
+ sub {
+ print STDERR $_[0];
+ push @warned, $_[0]
+ };
+
+
use Imager qw(:handy);
-plan tests => 2;
+plan tests => 3;
#my $fontfile = 'ImUgly.ttf';
#my $font = Imager::Font->new(file=>$fontfile, type => 'ft2', aa=>1)
$img1->write(file=>'testout/t11_basic.ppm') or die "Can't save img1: ".$img1->errstr."\n";
-
+unless (is(@warned, 0, "should be no warnings")) {
+ diag($_) for @warned;
+}
use Imager qw(:handy);
-plan tests => 2;
+plan tests => 3;
+
+my @warned;
+local $SIG{__WARN__} =
+ sub {
+ print STDERR $_[0];
+ push @warned, $_[0]
+ };
+
#my $fontfile = 'ImUgly.ttf';
#my $font = Imager::Font->new(file=>$fontfile, type => 'ft2', aa=>1)
$img1->write(file=>'testout/t12_basic.ppm') or die "Can't save img1: ".$img1->errstr."\n";
-
+unless (is(@warned, 0, "should be no warnings")) {
+ diag($_) for @warned;
+}
use Imager qw(:handy);
-plan tests => 2;
+plan tests => 3;
+
+my @warned;
+local $SIG{__WARN__} =
+ sub {
+ print STDERR $_[0];
+ push @warned, $_[0]
+ };
+
#my $fontfile = 'ImUgly.ttf';
#my $font = Imager::Font->new(file=>$fontfile, type => 'ft2', aa=>1)
$img1->write(file=>'testout/t13_basic.ppm') or die "Can't save img1: ".$img1->errstr."\n";
+unless (is(@warned, 0, "should be no warnings")) {
+ diag($_) for @warned;
+}