Slic3r/xs/t/03_point.t

23 lines
473 B
Perl
Raw Normal View History

2013-07-06 17:26:32 +04:00
#!/usr/bin/perl
use strict;
use warnings;
use Slic3r::XS;
2013-07-15 22:31:43 +04:00
use Test::More tests => 5;
2013-07-06 17:26:32 +04:00
2013-07-15 22:31:43 +04:00
my $point = Slic3r::Point->new(10, 15);
2013-07-06 17:26:32 +04:00
is_deeply [ @$point ], [10, 15], 'point roundtrip';
2013-07-15 18:04:49 +04:00
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';
2013-07-06 17:26:32 +04:00
__END__