This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
fix utf char > IV_MAX on 32-bit platforms
[perl5.git] / t / op / chars.t
index a2b6f51..2c31259 100644 (file)
@@ -2,11 +2,11 @@
 
 BEGIN {
     chdir 't' if -d 't';
-    @INC = '../lib';
     require './test.pl';
+    set_up_inc('../lib');
 }
 
-plan tests => 33;
+plan tests => 34;
 
 # because of ebcdic.c these should be the same on asciiish 
 # and ebcdic machines.
@@ -76,5 +76,13 @@ $c = "\c^";
 is (ord($c), 30, '\c^');
 $c = "\c_";
 is (ord($c), 31, '\c_');
+
+# '\c?' is an outlier, and is treated differently on each platform.
+# It's DEL on ASCII, and APC on EBCDIC
 $c = "\c?";
-is (ord($c), 127, '\c?');
+is (ord($c), ($::IS_ASCII)
+             ? 127
+             : utf8::unicode_to_native(0x9F),
+              '\c?');
+$c = '';
+is (ord($c), 0, 'ord("") is 0');