06_polygon.t 440 B

123456789101112131415161718192021
  1. #!/usr/bin/perl
  2. use strict;
  3. use warnings;
  4. use Slic3r::XS;
  5. use Test::More tests => 3;
  6. my $square = [ # ccw
  7. [100, 100],
  8. [200, 100],
  9. [200, 200],
  10. [100, 200],
  11. ];
  12. my $polygon = Slic3r::Polygon->new(@$square);
  13. is ref($polygon->arrayref), 'ARRAY', 'polygon arrayref is unblessed';
  14. isa_ok $polygon->[0], 'Slic3r::Point::Ref', 'polygon point is blessed';
  15. ok ref($polygon->first_point) eq 'Slic3r::Point', 'first_point';
  16. __END__