h2xs tweaks
[p5sagit/p5-mst-13.2.git] / t / op / tr.t
CommitLineData
c8e3bb4c 1# tr.t
2
f05dd7cc 3BEGIN {
4 chdir 't' if -d 't';
5 unshift @INC, "../lib";
6}
a5095b95 7
c8e3bb4c 8print "1..4\n";
9
10$_ = "abcdefghijklmnopqrstuvwxyz";
11
12tr/a-z/A-Z/;
13
14print "not " unless $_ eq "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
15print "ok 1\n";
16
17tr/A-Z/a-z/;
18
19print "not " unless $_ eq "abcdefghijklmnopqrstuvwxyz";
20print "ok 2\n";
21
22tr/b-y/B-Y/;
23
24print "not " unless $_ eq "aBCDEFGHIJKLMNOPQRSTUVWXYz";
25print "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#