File: 801-tr18561b.t

package info (click to toggle)
libimager-perl 1.027%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 6,820 kB
  • sloc: perl: 32,971; ansic: 28,092; makefile: 52; cpp: 4
file content (17 lines) | stat: -rw-r--r-- 471 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!perl -w
# variant on the code that produces 18561
# the old _color() code could return floating colors in some cases
# but in most cases the caller couldn't handle it
use strict;
use Test::More tests => 1;
eval {
  use Imager;
  use Imager::Color::Float; # prevent the actual 18561 crash
  my $i = Imager->new(
	  xsize => 50,
	  ysize => 50,
  );
  $i->line(x1 => 0, y1 => 0, x2 => 99, y2=>99, color => [ 0, 0, 0 ]);
};
ok(!$@, "shouldn't crash")
  or print "# $@\n";