From 0433a4eb785409f46a2d61e668fda84bd87c3148 Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Wed, 11 Nov 2009 16:08:13 +0100 Subject: [PATCH] +++: rangematch() fixes --- lib/List/Index.pm | 2 +- t/20-links.t | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) 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) = @$_; -- 2.30.0