Iterator-Flex
view release on metacpan or search on metacpan
t/Common/igather.t view on Meta::CPAN
{
exhaustion => 'throw',
cycle_on_exhaustion => GATHER_CYCLE_CHOOSE,
} );
my $limit = 0;
my @values;
isa_ok( dies { push @values, <$iter> while ++$limit < 20; },
['Iterator::Flex::Failure::Exhausted'], 'exhausted' );
is( $limit, 6, 'correct number of iterations' );
is(
\@values,
array {
item [ 0, 2, 4, 6, 8, 10, 12, 14, 16, 18 ];
item [ 20, 22, 24, 26, 28, 30, 32, 34, 36, 38 ];
item [ 40, 42, 44, 46, 48, 50, 52, 54, 56, 58 ];
item [ 60, 62, 64, 66, 68, 70, 72, 74, 76, 78 ];
item [ 80, 82, 84, 86, 88, 90, 92, 94, 96, 98 ];
end;
t/lib/MyTest/Utils.pm view on Meta::CPAN
}
else {
1 while defined <$iter> && ++$cnt < $max + 1;
}
};
my $err = $@;
my $ctx = context();
is( $cnt, $max, 'not enough or too few iterations' );
$ctx->release;
die $@ if $@;
}
1;
( run in 0.684 second using v1.01-cache-2.11-cpan-71847e10f99 )