From: Mischa POSLAWSKY Date: Wed, 11 Nov 2009 15:08:13 +0000 (+0100) Subject: +++: rangematch() fixes X-Git-Url: http://git.shiar.net/perl/list-index.git/commitdiff_plain/0433a4eb785409f46a2d61e668fda84bd87c3148 +++: rangematch() fixes --- diff --git a/lib/List/Index.pm b/lib/List/Index.pm index 9c86bc3..7214ced 100644 --- a/lib/List/Index.pm +++ b/lib/List/Index.pm @@ -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])" diff --git a/t/20-links.t b/t/20-links.t index 1180398..f8f462d 100644 --- a/t/20-links.t +++ b/t/20-links.t @@ -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) = @$_;