diff options
author | Abhijit Menon-Sen <ams@wiw.org> | 2002-11-07 01:08:11 +0530 |
---|---|---|
committer | hv <hv@crypt.org> | 2002-12-09 00:02:57 +0000 |
commit | ada6e8a992d3696f2a5e84c5e93d2fce8998ecfb (patch) | |
tree | d864841417cc4e3dbda7bab81e3a1e625168385a /t | |
parent | 3b9d212931c328bf8f0ad8c51694e8b569ec046e (diff) | |
download | perl-ada6e8a992d3696f2a5e84c5e93d2fce8998ecfb.tar.gz |
Re: [perl #18107] lc(), uc() and ucfirst() broken inside utf8 regex
Message-ID: <20021106193811.E20858@lustre.dyn.wiw.org>
p4raw-id: //depot/perl@18266
Diffstat (limited to 't')
-rw-r--r-- | t/op/lc.t | 17 |
1 files changed, 16 insertions, 1 deletions
@@ -1,6 +1,6 @@ #!./perl -print "1..51\n"; +print "1..55\n"; my $test = 1; @@ -136,3 +136,18 @@ ok(ucfirst("\x{3C3}") eq "\x{3A3}", "U+03C3 ucfirst is U+03A3, too"); ok(uc("\x{1C5}") eq "\x{1C4}", "U+01C5 uc is U+01C4"); ok(uc("\x{1C6}") eq "\x{1C4}", "U+01C6 uc is U+01C4, too"); +# #18107: A host of bugs involving [ul]c{,first}. AMS 20021106 +$a = "\x{3c3}foo.bar"; # \x{3c3} == GREEK SMALL LETTER SIGMA. +$b = "\x{3a3}FOO.BAR"; # \x{3a3} == GREEK CAPITAL LETTER SIGMA. + +($c = $b) =~ s/(\w+)/lc($1)/ge; +ok($c eq $a, "Using s///e to change case."); + +($c = $a) =~ s/(\w+)/uc($1)/ge; +ok($c eq $b, "Using s///e to change case."); + +($c = $b) =~ s/(\w+)/lcfirst($1)/ge; +ok($c eq "\x{3c3}FOO.bAR", "Using s///e to change case."); + +($c = $a) =~ s/(\w+)/ucfirst($1)/ge; +ok($c eq "\x{3a3}foo.Bar", "Using s///e to change case."); |