++: distribution tests
authorMischa POSLAWSKY <perl@shiar.org>
Sat, 14 Nov 2009 19:00:16 +0000 (20:00 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Sat, 14 Nov 2009 19:00:16 +0000 (20:00 +0100)
t/10-ranges.t

index 55df649fd835118519560f6bd7e69eb7332862ca..f935820eaf99904bb4007478b3b3c51be8eb568b 100644 (file)
@@ -56,18 +56,18 @@ subtest 'context' => sub {
 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
+               kkeg kl km kmlu knsy    koxb kpeo kuaa kuab kuac
+               kuap kuaq kuq kux kzb   lc lg lgu lgua lguc
+               lguq lgur lgus lgx 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'
+               $index->ranges({ pagesize=>10, context=>3 }),
+               # shorten 'kuap' to 'ku' because lookbehind is 'kp...'
+               # 'lguq' matches 'lg', but may only backtrack to 'lgu'
+               [qw(-kt ku-lgt lgu-)],
+               'lookbehind'
        );
 }
        is_deeply(