diff options
author | Karl Williamson <khw@cpan.org> | 2015-04-03 12:06:39 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2015-08-25 16:58:01 -0600 |
commit | 83bcbc6111ed334f239986aa6a0f00a47b523a0c (patch) | |
tree | c74d514180e57176b00df28f32d5a13f6d164021 /lib | |
parent | 8226f5083483c32f65ab0be1501060f802b10c04 (diff) | |
download | perl-83bcbc6111ed334f239986aa6a0f00a47b523a0c.tar.gz |
Various .t files: Use globals to see if on EBCDIC
These globals are already available; by using them instead of rolling
our own, it makes it easer to grep for these kinds of instances.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bytes.t | 6 | ||||
-rw-r--r-- | lib/utf8.t | 10 |
2 files changed, 8 insertions, 8 deletions
diff --git a/lib/bytes.t b/lib/bytes.t index 8fc535fefb..4e50ff3361 100644 --- a/lib/bytes.t +++ b/lib/bytes.t @@ -33,20 +33,20 @@ utf8::encode(my $c2_utf8 = $c2); { use bytes; - if (ord('A') == 193) { # EBCDIC? + if ($::IS_EBCDIC) { # EBCDIC? is(ord($c), 0x8c, "ord under use bytes looks at the 1st byte"); } else { is(ord($c), 0xc4, "ord under use bytes looks at the 1st byte"); } is(length($c), 2, "length under use bytes looks at bytes"); is(bytes::length($c), 2, "bytes::length under use bytes looks at bytes"); - if (ord('A') == 193) { # EBCDIC? + if ($::IS_EBCDIC) { # EBCDIC? is(bytes::ord($c), 0x8c, "bytes::ord under use bytes looks at the 1st byte"); } else { is(bytes::ord($c), 0xc4, "bytes::ord under use bytes looks at the 1st byte"); } # In z/OS \x41,\x8c are the codepoints corresponding to \x80,\xc4 respectively under ASCII platform - if (ord('A') == 193) { # EBCDIC? + if ($::IS_EBCDIC) { # EBCDIC? is(bytes::substr($c, 0, 1), "\x8c", "bytes::substr under use bytes looks at bytes"); is(bytes::index($c, "\x41"), 1, "bytes::index under use bytes looks at bytes"); is(bytes::rindex($c, "\x8c"), 0, "bytes::rindex under use bytes looks at bytes"); diff --git a/lib/utf8.t b/lib/utf8.t index bf722f3797..275e7c95a5 100644 --- a/lib/utf8.t +++ b/lib/utf8.t @@ -270,7 +270,7 @@ BANG # "my" variable $strict::VERSION can't be in a package # SKIP: { - skip("Embedded UTF-8 does not work in EBCDIC", 1) if ord("A") == 193; + skip("Embedded UTF-8 does not work in EBCDIC", 1) if $::IS_EBCDIC; ok('' eq runperl(prog => <<'CODE'), "change #17928"); my $code = qq{ my \$\xe3\x83\x95\xe3\x83\xbc = 5; }; { @@ -324,7 +324,7 @@ END } SKIP: { - skip("Embedded UTF-8 does not work in EBCDIC", 1) if ord("A") == 193; + skip("Embedded UTF-8 does not work in EBCDIC", 1) if $::IS_EBCDIC; use utf8; is eval qq{q \xc3\xbc test \xc3\xbc . qq\xc2\xb7 test \xc2\xb7}, ' test test ', @@ -347,7 +347,7 @@ SKIP: { ok( utf8::is_utf8($c), "utf8::is_utf8 unicode"); is(utf8::upgrade($a), 1, "utf8::upgrade basic"); - if (ord('A') == 193) { # EBCDIC. + if ($::IS_EBCDIC) { # EBCDIC. is(utf8::upgrade($b), 1, "utf8::upgrade beyond"); } else { is(utf8::upgrade($b), 2, "utf8::upgrade beyond"); @@ -383,7 +383,7 @@ SKIP: { utf8::encode($c); is($a, "A", "basic"); - if (ord('A') == 193) { # EBCDIC. + if ($::IS_EBCDIC) { # EBCDIC. is(length($b), 1, "beyond length"); } else { is(length($b), 2, "beyond length"); @@ -412,7 +412,7 @@ SKIP: { ok(utf8::valid($c), " utf8::valid unicode"); ok(!utf8::is_utf8($a), "!utf8::is_utf8 basic"); - if (ord('A') == 193) { # EBCDIC. + if ($::IS_EBCDIC) { # EBCDIC. ok( utf8::is_utf8(pack('U',0x0ff)), " utf8::is_utf8 beyond"); } else { ok( utf8::is_utf8($b), " utf8::is_utf8 beyond"); # $b stays in UTF-8. |