From a0438ade03450c7141821f7f8aa25d3a8e39d849 Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Fri, 13 Nov 2009 16:00:17 +0100 Subject: [PATCH] test ranges distribution --- t/10-ranges.t | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/t/10-ranges.t b/t/10-ranges.t index ef292b1..55df649 100644 --- a/t/10-ranges.t +++ b/t/10-ranges.t @@ -2,7 +2,7 @@ use strict; use warnings; -use Test::More tests => 6; +use Test::More tests => 7; use Test::NoWarnings; use Data::Dump 'pp'; @@ -53,3 +53,27 @@ subtest 'context' => sub { #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' + ); +} + -- 2.30.0