diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2002-01-01 03:35:01 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2002-01-01 03:35:01 +0000 |
commit | ffce6cc29631cbe46068af7601780981e4969f2a (patch) | |
tree | 22070032294df853b24e3fa8835468d85a183fab /t | |
parent | 99f22665d16e539ac96fd8697c65cfa96010d82d (diff) | |
download | perl-ffce6cc29631cbe46068af7601780981e4969f2a.tar.gz |
Unnecessary/Lingering UTF8 flag might mess up caseless matching
(found by Jeffrey Friedl)
p4raw-id: //depot/perl@13992
Diffstat (limited to 't')
-rwxr-xr-x | t/op/pat.t | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/t/op/pat.t b/t/op/pat.t index 0eda689cc5..b797bdffbb 100755 --- a/t/op/pat.t +++ b/t/op/pat.t @@ -6,7 +6,7 @@ $| = 1; -print "1..825\n"; +print "1..828\n"; BEGIN { chdir 't' if -d 't'; @@ -2520,3 +2520,41 @@ print "# some Unicode properties\n"; $& eq "franc\N{COMBINING CEDILLA}ais" ? "ok 825\n" : "not ok 825\n"; } + +{ + print "# Does lingering (and useless) UTF8 flag mess up /i matching?\n"; + + { + my $regex = "ABcde"; + my $string = "abcDE\x{100}"; + chop($string); + if ($string =~ m/$regex/i) { + print "ok 826\n"; + } else { + print "not ok 826\n"; + } + } + + { + my $regex = "ABcde\x{100}"; + my $string = "abcDE"; + chop($regex); + if ($string =~ m/$regex/i) { + print "ok 827\n"; + } else { + print "not ok 827\n"; + } + } + + { + my $regex = "ABcde\x{100}"; + my $string = "abcDE\x{100}"; + chop($regex); + chop($string); + if ($string =~ m/$regex/i) { + print "ok 828\n"; + } else { + print "not ok 828\n"; + } + } +} |