Array-IntSpan
view release on metacpan or search on metacpan
t/clobbered_items.t view on Meta::CPAN
ok ( defined($r) , 'Array::IntSpan new() works') ;
is_deeply( $r , \@expect, 'new content ok') ;
foreach my $t (
[[32,34,'oops'],[]],
[[4,4,'oops'],[]],
[[24,26,'oops'],[[24,26,'ef']]],
[[24,29,'oops'],[[24,26,'ef']]],
[[10,16,'oops'],[[13,16,'ef']]],
[[20,24,'oops'],[[20,24,'ef']]],
[[0,9,'oops'],[[1,3,'ab'],[5,7,'cd']]],
[[0,6,'oops'],[[1,3,'ab'],[5,6,'cd']]],
)
{
my @clobbered = $r->clobbered_items(@{$t->[0]}) ;
is(@$r, 3, 'check nb of items in range') || diag(Dumper $r);
is_deeply(\@clobbered, $t->[1], "clobbered_items @{$t->[0]}") ||
diag(Dumper \@clobbered) ;
}
t/get_range.t view on Meta::CPAN
ok ( defined($r) , 'Array::IntSpan new() works') ;
is_deeply( $r , \@expect, 'new content ok') ;
foreach my $t (
[[32,34],[]],
[[4,4],[]],
[[24,26],[[24,26,'ef']]],
[[24,29],[[24,26,'ef']]],
[[10,16],[[13,16,'ef']]],
[[20,24],[[20,24,'ef']]],
[[0,9],[[1,3,'ab'],[5,7,'cd']]],
[[0,6],[[1,3,'ab'],[5,6,'cd']]],
)
{
my $new = $r->get_range(@{$t->[0]}) ;
is_deeply($new, $t->[1], "get_range @{$t->[0]}") ||
diag("From ".Dumper($r)."Got ".Dumper ($new)) ;
is(@$r, 3, 'check nb of items in range') || diag(Dumper $r);
}
t/get_range.t view on Meta::CPAN
[24,29],
[[24,26,'ef'],[27,29,$fill]],
[[1,3,'ab'],[5, 7, 'cd'], [13, 23,'ef'],[24,26,'ef'],[27,29,$fill]]
],
[
[10,16],
[[10,12,$fill],[13,16,'ef']],
[[1,3,'ab'],[5, 7, 'cd'], [10,12,$fill],,[13,16,'ef'],[17, 26, 'ef']]
],
[
[20,24],
[[20,24,'ef']],
[[1,3,'ab'],[5, 7,'cd'],[13,19,'ef'],[20,24,'ef'],[25,26,'ef']]
],
[
[0,9],
[[0,0,$fill],[1,3,'ab'],[4,4,$fill],[5,7,'cd'],[8,9,$fill]],
[[0,0,$fill],[1,3,'ab'],[4,4,$fill],[5,7,'cd'],[8,9,$fill], [13, 26, 'ef']]
],
[
[0,6],
[[0,0,$fill],[1,3,'ab'],[4,4,$fill],[5,6,'cd']],
[[0,0,$fill],[1,3,'ab'],[4,4,$fill],[5,6,'cd'],[7,7,'cd'], [13, 26, 'ef']]
( run in 0.348 second using v1.01-cache-2.11-cpan-7add2cbd662 )