This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
test in change#4428 needs strict interpretation of C modulus
[perl5.git] / t / op / tr.t
1 # tr.t
2
3 BEGIN {
4     chdir 't' if -d 't';
5     unshift @INC, "../lib";
6 }
7
8 print "1..4\n";
9
10 $_ = "abcdefghijklmnopqrstuvwxyz";
11
12 tr/a-z/A-Z/;
13
14 print "not " unless $_ eq "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
15 print "ok 1\n";
16
17 tr/A-Z/a-z/;
18
19 print "not " unless $_ eq "abcdefghijklmnopqrstuvwxyz";
20 print "ok 2\n";
21
22 tr/b-y/B-Y/;
23
24 print "not " unless $_ eq "aBCDEFGHIJKLMNOPQRSTUVWXYz";
25 print "ok 3\n";
26
27 # In EBCDIC 'I' is \xc9 and 'J' is \0xd1, 'i' is \x89 and 'j' is \x91.
28 # Yes, discontinuities.  Regardless, the \xca in the below should stay
29 # untouched (and not became \x8a).
30 {
31     no utf8;
32     $_ = "I\xcaJ";
33
34     tr/I-J/i-j/;
35
36     print "not " unless $_ eq "i\xcaj";
37     print "ok 4\n";
38 }
39 #