]> git.imager.perl.org - imager.git/blob - t/tr18561b.t
use SvPV to get the length of text to draw rather than strlen(), add
[imager.git] / t / tr18561b.t
1 #!perl -w
2 # variant on the code that produces 18561
3 # the old _color() code could return floating colors in some cases
4 # but in most cases the caller couldn't handle it
5 use strict;
6 use lib 't';
7 use Test::More tests => 1;
8 eval {
9   use Imager;
10   use Imager::Color::Float; # prevent the actual 18561 crash
11   my $i = Imager->new(
12           xsize => 50,
13           ysize => 50,
14   );
15   $i->line(x1 => 0, y1 => 0, x2 => 99, y2=>99, color => [ 0, 0, 0 ]);
16 };
17 ok(!$@, "shouldn't crash")
18   or print "# $@\n";