tr/// UTF-8 tests for Inaba Hiroto's latest patches.
Jarkko Hietaniemi [Tue, 20 Mar 2001 05:04:25 +0000 (05:04 +0000)]
p4raw-id: //depot/perl@9257

t/op/tr.t

index e114464..e815cf2 100755 (executable)
--- a/t/op/tr.t
+++ b/t/op/tr.t
@@ -5,7 +5,7 @@ BEGIN {
     @INC = '../lib';
 }
 
-print "1..61\n";
+print "1..65\n";
 
 $_ = "abcdefghijklmnopqrstuvwxyz";
 
@@ -350,3 +350,20 @@ print "ok 61\n";
 } else {
   for (60..61) { print "ok $_ # Skip: not EBCDIC\n" }
 }
+
+($a = "\x{100}") =~ tr/\x00-\xff/X/c;
+print "not " unless ord($a) == ord("X");
+print "ok 62\n";
+
+($a = "\x{100}") =~ tr/\x00-\xff/X/cs;
+print "not " unless ord($a) == ord("X");
+print "ok 63\n";
+
+($a = "\x{100}\x{100}") =~ tr/\x{101}-\x{200}//c;
+print "not " unless $a eq "\x{100}\x{100}";
+print "ok 64\n";
+
+($a = "\x{100}\x{100}") =~ tr/\x{101}-\x{200}//cs;
+print "not " unless $a eq "\x{100}";
+print "ok 65\n";
+