use strict;
use warnings;
-use Clutter::TestHelper tests => 48;
+use Clutter::TestHelper tests => 49;
use Champlain;
my $polygon = Champlain::Polygon->new();
isa_ok($polygon, 'Champlain::Polygon');
+ my @remove = ();
+
$polygon->append_point(8, 4);
is_polygon(
$polygon,
"append_point()"
);
- $polygon->append_point(4, 9);
+ push @remove, $polygon->append_point(4, 9);
is_polygon(
$polygon,
[
"polygon: 4 points"
);
- $polygon->insert_point(1, 2, 0);
+ push @remove, $polygon->insert_point(1, 2, 0);
is_polygon(
$polygon,
[
"insert_point() at the end"
);
- $polygon->insert_point(30, 240, 17);
+ push @remove, $polygon->insert_point(30, 240, 17);
is_polygon(
$polygon,
[
"insert_point() past the end"
);
+ foreach my $point (@remove) {
+ $polygon->remove_point($point);
+ }
+ is_polygon(
+ $polygon,
+ [
+ 8, 4,
+ 7, 10,
+ 5, 3,
+ 10, 20,
+ ],
+ "remove_point()"
+ );
+
+
# Clear the polygon (it should be empty after)
TODO: {
local $TODO = "Bug in libchamplain";