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