+ is_deeply(
+ $index->ranges({ pagesize=>10, context=>0, length=>5 }),
+ # ranges should match offsets exactly
+ [qw(-kuap. kuapa-lgup lguq-)],
+ 'no context'
+ );
+ is_deeply(
+ $index->ranges({ pagesize=>10, context=>0 }),
+ # default length limits to 4 chars
+ [qw(-kuao kuap-lgup lguq-)],
+ 'default length'
+ );
+ is_deeply(
+ $index->ranges({ pagesize=>10, context=>1 }),
+ # lookbehinds aren't shorter (kuac<kuap, lguc<lguq)
+ # 'kuap' can advance to 'kuq'
+ [qw(-kup kuq-lgup lguq-)],
+ 'lookahead'
+ );
+TODO: {
+ local $TODO = 'backtrack';
+ is_deeply(
+ $index->ranges({ pagesize=>10, context=>2 }),
+ # allowed to advance to 'kur', but provides no benefits over 'kuq'
+ [qw(-kup kuq-lgup lguq-)],
+ 'minimal lookahead'
+ );
+}