X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2Fbytes.t;h=c1ea9ead80792bb4b533bd545cd68a5c07ad90b5;hb=55f4245edad4e38b1869f0a6467a997a59257a0f;hp=6b66a554b27576a9e4584b299c5b0f81363a5093;hpb=579f6b362c1dba5aba4049a91c9b6ef08e1b2c6d;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/bytes.t b/lib/bytes.t index 6b66a55..c1ea9ea 100644 --- a/lib/bytes.t +++ b/lib/bytes.t @@ -1,10 +1,11 @@ + BEGIN { chdir 't' if -d 't'; @INC = '../lib'; require './test.pl'; } -plan tests => 19; +plan tests => 20; my $a = chr(0x100); @@ -42,7 +43,23 @@ 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"); + } + +} + +{ + fresh_perl_like ('use bytes; bytes::moo()', + qr/Undefined subroutine bytes::moo/, {stderr=>1}, + "Check Carp is loaded for AUTOLOADing errors") }