486b4515d58eb19469c65454467737d7860a0168
[p5sagit/p5-mst-13.2.git] / t / op / tr.t
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     no utf8;
27     $_ = "I\xcaJ";
28
29     tr/I-J/i-j/;
30
31     print "not " unless $_ eq "i\xcaj";
32     print "ok 4\n";
33 }
34 #