my $pagesize = $options->{pagesize} || 50;
my $context = $options->{context } // 1 + ($pagesize >> 4);
my $length = $options->{length } || 4;
- my $pages = $options->{pages } || 1 + int $#rows / $pagesize;
+ my $pages = $options->{pages } || 1 + int($#rows / $pagesize);
- $pagesize = $pages >= $#rows ? 1 : @rows / $pages;
+ $pagesize = $pages >= @rows ? 1 : @rows / $pages;
my $shrunk = 0;
my $enlarged = 0;
use strict;
use warnings;
-use Test::More tests => 9;
+use Test::More tests => 10;
use Test::NoWarnings;
use Data::Dump 'pp';
);
};
+subtest 'corner cases' => sub {
+ plan tests => 1;
+
+ is_deeply(
+ List::Index->new->ranges(['foo','bar']),
+ ['-'],
+ '2 rows 1 page'
+ );
+};
+
subtest 'context' => sub {
plan tests => 4;
my @data = qw( baa1 baa2 baa3 baaa bbc cbc daaa ea eaaa zed );