More integration of Slic3r::Point::XS

This commit is contained in:
Alessandro Ranellucci 2013-07-15 16:04:49 +02:00
parent 159a009f96
commit c9749ca3b3
9 changed files with 80 additions and 17 deletions

View file

@ -4,11 +4,21 @@ use strict;
use warnings;
use Slic3r::XS;
use Test::More tests => 2;
use Test::More tests => 6;
my $point = Slic3r::Point::XS->new(10, 15);
is_deeply [ @$point ], [10, 15], 'point roundtrip';
isa_ok $point->arrayref, 'Slic3r::Point', 'Perl point is blessed';
my $point2 = $point->clone;
$point2->scale(2);
is_deeply [ @$point2 ], [20, 30], 'scale';
$point2->translate(10, -15);
is_deeply [ @$point2 ], [30, 15], 'translate';
ok $point->coincides_with($point->clone), 'coincides_with';
ok !$point->coincides_with($point2), 'coincides_with';
__END__