Add test for polyline lines
This commit is contained in:
parent
439255ca46
commit
77c479c127
3 changed files with 34 additions and 19 deletions
27
xs/t/09_polyline.t
Normal file
27
xs/t/09_polyline.t
Normal file
|
@ -0,0 +1,27 @@
|
|||
#!/usr/bin/perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Slic3r::XS;
|
||||
use Test::More tests => 4;
|
||||
|
||||
my $points = [
|
||||
[100, 100],
|
||||
[200, 100],
|
||||
[200, 200],
|
||||
];
|
||||
|
||||
my $polyline = Slic3r::Polyline->new(@$points);
|
||||
is_deeply $polyline->pp, $points, 'polyline roundtrip';
|
||||
|
||||
is ref($polyline->arrayref), 'ARRAY', 'polyline arrayref is unblessed';
|
||||
isa_ok $polyline->[0], 'Slic3r::Point', 'polyline point is blessed';
|
||||
|
||||
my $lines = $polyline->lines;
|
||||
is_deeply [ map $_->pp, @$lines ], [
|
||||
[ [100, 100], [200, 100] ],
|
||||
[ [200, 100], [200, 200] ],
|
||||
], 'polyline lines';
|
||||
|
||||
__END__
|
Loading…
Add table
Add a link
Reference in a new issue