+++: rangematch() fixes
authorMischa POSLAWSKY <perl@shiar.org>
Wed, 11 Nov 2009 15:08:13 +0000 (16:08 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Wed, 11 Nov 2009 15:08:24 +0000 (16:08 +0100)
lib/List/Index.pm
t/20-links.t

index 9c86bc3e62ca39787ee6d4aa98ac28b18a1b223f..7214ced50c43057d929f8f34b9bf943016e134e3 100644 (file)
@@ -90,7 +90,7 @@ sub rangematch {
                        if (length $s1 > $i) {
                                my $c1 = substr $s1, $i, 1;
                                if ($s1 =~ /^\Q$prefix/) {
-                                       next if $c1 eq $char;
+                                       next if $c1 le $char;
                                }
                        }
                        push @allow, $prefix."(?![$char-$last])"
index 11803985c362a70ef2db9bebe8d965a6e6f7f34b..f8f462da980cd10ad329326a31de19d7263ef427 100644 (file)
@@ -2,7 +2,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 21;
+use Test::More tests => 22;
 use Test::NoWarnings;
 use Data::Dump 'pp';
 
@@ -27,6 +27,7 @@ for (
        [  'q-xxx' =>                '(?:[q-w]|x(?![x-z])|xx(?![x-z])|xxx)'],
        ['qqq-x'   => '(?:[r-x]|q[r-z]|qq[q-z])'],
        ['qaa-qb'  =>              '(?:qa[a-z]|qb)'],
+       ['qaa-qq'  =>       '(?:q[b-p]|qa[a-z]|qq)'],
        ['qqq-q'   =>       '(?:q[r-z]|qq[q-z])'],
 ) {
        my ($in, $out) = @$_;