use strict;
use warnings;
-use Test::More tests => 6;
+use Test::More tests => 7;
use Test::NoWarnings;
use Data::Dump 'pp';
#pp($index->ranges({pagesize => 2, context => 2, length => 1}));
};
+subtest 'distribution' => sub {
+ plan tests => 2;
+ my $index = List::Index->new([qw(
+ kkeg kl km kmlu knsy koxb kpeo kqbt krzu ktyp
+ kuap kuy kvbc kyy kzb lc lg lgaa lgbv lgbw
+ lgu lij ljr ljs lka lkq lks lln llq llx
+ )]) or return;
+TODO: {
+ local $TODO = 'under development';
+ is_deeply(
+ $index->ranges({ pagesize=>10, context=>5 }),
+ # after 'kuap' forwards to 'kzb', 'lgu' shouldn't go back to 'lc'
+ # otherwise we get qw[-k l-]
+ [qw(-k l-lg lgu-)],
+ 'lookbehind after full lookahead'
+ );
+}
+ is_deeply(
+ $index->ranges({ pagesize=>10, context=>4 }),
+ [qw(-kt ku-lf lg-)],
+ 'maximal lookahead'
+ );
+}
+