summaryrefslogtreecommitdiff
path: root/lib/bytes.t
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2015-04-03 12:06:39 -0600
committerKarl Williamson <khw@cpan.org>2015-08-25 16:58:01 -0600
commit83bcbc6111ed334f239986aa6a0f00a47b523a0c (patch)
treec74d514180e57176b00df28f32d5a13f6d164021 /lib/bytes.t
parent8226f5083483c32f65ab0be1501060f802b10c04 (diff)
downloadperl-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/bytes.t')
-rw-r--r--lib/bytes.t6
1 files changed, 3 insertions, 3 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");