summaryrefslogtreecommitdiff
path: root/t/op/tr.t
diff options
context:
space:
mode:
authorNick Ing-Simmons <nik@tiuk.ti.com>2001-03-05 19:47:57 +0000
committerNick Ing-Simmons <nik@tiuk.ti.com>2001-03-05 19:47:57 +0000
commit750f29311ec133810c8ae6ff7015822513e1b5de (patch)
treec464fd51e442a84a7c989dbf6f0c2d5cb7d2ea09 /t/op/tr.t
parent96005c11c83f45ebaa8e91258fe25c5715fdac75 (diff)
downloadperl-750f29311ec133810c8ae6ff7015822513e1b5de.tar.gz
Integrate mainline (mostly - holding of on Encode.pm for a bit.)
p4raw-id: //depot/perlio@9048
Diffstat (limited to 't/op/tr.t')
-rwxr-xr-xt/op/tr.t27
1 files changed, 26 insertions, 1 deletions
diff --git a/t/op/tr.t b/t/op/tr.t
index eb5c4ca27b..e1144641c3 100755
--- a/t/op/tr.t
+++ b/t/op/tr.t
@@ -5,7 +5,7 @@ BEGIN {
@INC = '../lib';
}
-print "1..57\n";
+print "1..61\n";
$_ = "abcdefghijklmnopqrstuvwxyz";
@@ -325,3 +325,28 @@ print "ok 56\n";
print "not " unless $a eq "X";
print "ok 57\n";
+# Tricky on EBCDIC: while [a-z] [A-Z] must not match the gap characters,
+# (i-j, r-s, I-J, R-S), [\x89-\x91] [\xc9-\xd1] has to match them,
+# from Karsten Sperling.
+
+$c = ($a = "\x89\x8a\x8b\x8c\x8d\x8f\x90\x91") =~ tr/\x89-\x91/X/;
+print "not " unless $c == 8 and $a eq "XXXXXXXX";
+print "ok 58\n";
+
+$c = ($a = "\xc9\xca\xcb\xcc\xcd\xcf\xd0\xd1") =~ tr/\xc9-\xd1/X/;
+print "not " unless $c == 8 and $a eq "XXXXXXXX";
+print "ok 59\n";
+
+if (ord('i') == 0x89 & ord('J') == 0xd1) {
+
+$c = ($a = "\x89\x8a\x8b\x8c\x8d\x8f\x90\x91") =~ tr/i-j/X/;
+print "not " unless $c == 2 and $a eq "X\x8a\x8b\x8c\x8d\x8f\x90X";
+print "ok 60\n";
+
+$c = ($a = "\xc9\xca\xcb\xcc\xcd\xcf\xd0\xd1") =~ tr/I-J/X/;
+print "not " unless $c == 2 and $a eq "X\xca\xcb\xcc\xcd\xcf\xd0X";
+print "ok 61\n";
+
+} else {
+ for (60..61) { print "ok $_ # Skip: not EBCDIC\n" }
+}