Some tests were failing

This commit is contained in:
Alessandro Ranellucci 2011-10-10 11:00:19 +02:00
parent 02a1b0cdab
commit 7628c83e9f
5 changed files with 64 additions and 65 deletions

View file

@ -1,4 +1,6 @@
use Test::More;
use strict;
use warnings;
plan tests => 1;
@ -20,7 +22,7 @@ my $hole_in_square = [ # cw
[16, 14],
];
my $square = [ # ccw
my $square2 = [ # ccw
[5, 12],
[25, 12],
[25, 18],
@ -28,7 +30,7 @@ my $square = [ # ccw
];
$clipper->add_subject_polygons([ $square, $hole_in_square ]);
$clipper->add_clip_polygons([ $square ]);
$clipper->add_clip_polygons([ $square2 ]);
my $intersection = $clipper->ex_execute(CT_INTERSECTION, PFT_NONZERO, PFT_NONZERO);
is_deeply $intersection, [
@ -42,10 +44,10 @@ is_deeply $intersection, [
],
],
outer => [
[5, 18],
[5, 12],
[25, 12],
[25, 18],
[10, 18],
[10, 12],
[20, 12],
[20, 18],
],
},
], 'hole is preserved after intersection';