Commit | Line | Data |
c8e3bb4c |
1 | # tr.t |
2 | |
f05dd7cc |
3 | BEGIN { |
4 | chdir 't' if -d 't'; |
5 | unshift @INC, "../lib"; |
6 | } |
a5095b95 |
7 | |
c8e3bb4c |
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). |
5e037136 |
30 | { |
31 | no utf8; |
32 | $_ = "I\xcaJ"; |
c8e3bb4c |
33 | |
5e037136 |
34 | tr/I-J/i-j/; |
c8e3bb4c |
35 | |
5e037136 |
36 | print "not " unless $_ eq "i\xcaj"; |
37 | print "ok 4\n"; |
38 | } |
c8e3bb4c |
39 | # |