+{ # RT #535
+ # no font parameter would crash
+ my $im = $pie->draw
+ (
+ data => \@data,
+ title => 'test',
+ );
+ ok(!$im, "should fail to produce titled graph with no font");
+ like($pie->error, qr/title\.font/, "message should mention which font");
+
+ $im = $pie->draw
+ (
+ labels => \@labels,
+ data => \@data,
+ features => [ 'legend' ],
+ );
+ ok(!$im, "should fail to produce legended graph with no font");
+ like($pie->error, qr/legend\.font/, "message should mention which font");
+
+ $im = $pie->draw
+ (
+ data => \@data,
+ labels => \@labels,
+ features => [ 'legend' ],
+ legend => { orientation => "horizontal" },
+ );
+ ok(!$im, "should fail to produce horizontal legended graph with no font");
+ like($pie->error, qr/legend\.font/, "message should mention which font");
+
+ $im = $pie->draw
+ (
+ data => \@data,
+ labels => \@labels,
+ );
+ ok(!$im, "should fail to produce labelled graph with no font");
+ like($pie->error, qr/label\.font/, "message should mention which font");
+
+ SKIP:
+ {
+ $font
+ or skip("No font to setup the callout font", 2);
+ $im = $pie->draw
+ (
+ data => \@data,
+ labels => \@labels,
+ features => [ 'allcallouts' ],
+ label => { font => $font },
+ );
+ ok(!$im, "should fail to produce callout labelled graph with no font");
+ like($pie->error, qr/callout\.font/, "message should mention which font");
+ }
+}
+