diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2006-07-13 22:47:29 +0300 |
---|---|---|
committer | H.Merijn Brand <h.m.brand@xs4all.nl> | 2006-07-13 17:12:00 +0000 |
commit | 2f3efc978ada94e3718bd6f3a25b06cd1d13b6f8 (patch) | |
tree | 4fbd3f59e65577085646ea3f266175edf15efd1e /lib/bytes.t | |
parent | 6ae709ad20fb5debe5f58c9686ed99226819442f (diff) | |
download | perl-2f3efc978ada94e3718bd6f3a25b06cd1d13b6f8.tar.gz |
z/OS: non-CPAN ext and lib + main() without the third arg + Stephen McCamant's comment
Message-ID: <44B67921.6090901@iki.fi>
p4raw-id: //depot/perl@28567
Diffstat (limited to 'lib/bytes.t')
-rw-r--r-- | lib/bytes.t | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/lib/bytes.t b/lib/bytes.t index ea1b9f629b..c1ea9ead80 100644 --- a/lib/bytes.t +++ b/lib/bytes.t @@ -1,3 +1,4 @@ + BEGIN { chdir 't' if -d 't'; @INC = '../lib'; @@ -42,9 +43,19 @@ my $c = chr(0x100); } else { is(bytes::ord($c), 0xc4, "bytes::ord under use bytes looks at the 1st byte"); } - is(bytes::substr($c, 0, 1), "\xc4", "bytes::substr under use bytes looks at bytes"); - is(bytes::index($c, "\x80"), 1, "bytes::index under use bytes looks at bytes"); - is(bytes::rindex($c, "\xc4"), 0, "bytes::rindex under use bytes looks at bytes"); + # In z/OS \x41,\x8c are the codepoints corresponding to \x80,\xc4 respectively under ASCII platform + if (ord('A') == 193) { # 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"); + + } + else{ + is(bytes::substr($c, 0, 1), "\xc4", "bytes::substr under use bytes looks at bytes"); + is(bytes::index($c, "\x80"), 1, "bytes::index under use bytes looks at bytes"); + is(bytes::rindex($c, "\xc4"), 0, "bytes::rindex under use bytes looks at bytes"); + } + } { |