Commit | Line | Data |
c8e3bb4c |
1 | # tr.t |
2 | |
a5095b95 |
3 | chdir 't' if -d 't'; |
4 | @INC = "../lib"; |
5 | |
c8e3bb4c |
6 | print "1..4\n"; |
7 | |
8 | $_ = "abcdefghijklmnopqrstuvwxyz"; |
9 | |
10 | tr/a-z/A-Z/; |
11 | |
12 | print "not " unless $_ eq "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; |
13 | print "ok 1\n"; |
14 | |
15 | tr/A-Z/a-z/; |
16 | |
17 | print "not " unless $_ eq "abcdefghijklmnopqrstuvwxyz"; |
18 | print "ok 2\n"; |
19 | |
20 | tr/b-y/B-Y/; |
21 | |
22 | print "not " unless $_ eq "aBCDEFGHIJKLMNOPQRSTUVWXYz"; |
23 | print "ok 3\n"; |
24 | |
25 | # In EBCDIC 'I' is \xc9 and 'J' is \0xd1, 'i' is \x89 and 'j' is \x91. |
26 | # Yes, discontinuities. Regardless, the \xca in the below should stay |
27 | # untouched (and not became \x8a). |
5e037136 |
28 | { |
29 | no utf8; |
30 | $_ = "I\xcaJ"; |
c8e3bb4c |
31 | |
5e037136 |
32 | tr/I-J/i-j/; |
c8e3bb4c |
33 | |
5e037136 |
34 | print "not " unless $_ eq "i\xcaj"; |
35 | print "ok 4\n"; |
36 | } |
c8e3bb4c |
37 | # |