+ )], 'default ranges');
+ is_deeply($index->ranges({pagesize => 300}), [qw(-c d-n o-)], 'large pagesize');
+};
+
+subtest 'context' => sub {
+ plan tests => 4;
+ my $index = List::Index->new([qw(
+ baa1 baa2 baa3 baaa bbc cbc daaa ea eaaa zed
+ )]) or return;
+ is_deeply($index->ranges({pagesize => 2, context => 0}), [
+ qw(-baa. baa.-bbb bbc-daa. daaa-eaa. eaaa-)
+ ], 'no context');
+ is_deeply($index->ranges({pagesize => 2}), [
+ qw(-a b c d e-)
+ ], 'default context'); # context should be 1
+ is_deeply($index->ranges({pagesize => 2, context => 2}), [
+ qw(-a b-c d e-)
+ ], 'overlap'); # first item equals second due to large context
+ is_deeply($index->ranges({pagesize => 2, context => 0, length => 1}), [
+ qw(-a b-c d e-)
+ ], 'single char');