This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #72724] explicit return doesn’t work with lvalue subs
[perl5.git] / t / op / lc_user.t
1 BEGIN {
2     chdir 't';
3     @INC = '../lib';
4     require './test.pl';
5 }
6
7 plan tests => 5;
8
9 %utf8::ToSpecUpper = (
10 "s" => "SS",            # Make sure can handle weird ASCII translations
11 );
12
13 sub ToUpper {
14     return <<END;
15 0061    0063    0041
16 END
17 }
18
19 is("\Ufoo\x{101}", "foo\x{101}", "no changes on 'foo'");
20 is("\Ubar\x{101}", "BAr\x{101}", "changing 'ab' on 'bar' ");
21 my $s = 's';
22 utf8::upgrade $s;
23 is(uc($s), "SS", "Verify uc('s') is 'SS' with our weird xlation, and utf8");
24
25 sub ToLower {
26     return <<END;
27 0041            0061
28 END
29 }
30
31 is("\LFOO\x{100}", "FOO\x{100}", "no changes on 'FOO'");
32 is("\LBAR\x{100}", "BaR\x{100}", "changing 'A' on 'BAR' ");
33