diff options
author | Alessandro Ranellucci <aar@cpan.org> | 2015-07-02 15:29:20 +0300 |
---|---|---|
committer | Alessandro Ranellucci <aar@cpan.org> | 2015-07-02 15:29:20 +0300 |
commit | b14290b9f67b3dfe12a5547eafcd434ae9fd0c75 (patch) | |
tree | ff7e9cfcc75065fde2e04016e61c65eb20325733 /t | |
parent | 5571144c0ec51a3ffbabe5a357982f2a8b593c8c (diff) |
Make tests happy
Diffstat (limited to 't')
-rw-r--r-- | t/perimeters.t | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/t/perimeters.t b/t/perimeters.t index dc2644e9d..d103eb3f2 100644 --- a/t/perimeters.t +++ b/t/perimeters.t @@ -329,13 +329,16 @@ use Slic3r::Test; scalar(@$expolygons), 'expected number of collections'; ok !defined(first { !$_->isa('Slic3r::ExtrusionPath::Collection') } @{$g->loops}), 'everything is returned as collections'; - is scalar(map @$_, @{$g->loops}), + + my $flattened_loops = $g->loops->flatten; + my @loops = @$flattened_loops; + is scalar(@loops), $expected{total}, 'expected number of loops'; - is scalar(grep $_->role == EXTR_ROLE_EXTERNAL_PERIMETER, map @$_, map @$_, @{$g->loops}), + is scalar(grep $_->role == EXTR_ROLE_EXTERNAL_PERIMETER, map @$_, @loops), $expected{external}, 'expected number of external loops'; - is scalar(grep $_->role == EXTRL_ROLE_CONTOUR_INTERNAL_PERIMETER, map @$_, @{$g->loops}), + is scalar(grep $_->role == EXTRL_ROLE_CONTOUR_INTERNAL_PERIMETER, @loops), $expected{cinternal}, 'expected number of internal contour loops'; - is scalar(grep $_->polygon->is_counter_clockwise, map @$_, @{$g->loops}), + is scalar(grep $_->polygon->is_counter_clockwise, @loops), $expected{ccw}, 'expected number of ccw loops'; return $g; |