From: Jarkko Hietaniemi Date: Wed, 15 May 2002 20:31:02 +0000 (+0000) Subject: Fix some of the EBCDIC vs Storable failures, from Nicholas Clark. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7e416500dc6c4c6563805114e7c3ad0316b80bed;p=p5sagit%2Fp5-mst-13.2.git Fix some of the EBCDIC vs Storable failures, from Nicholas Clark. p4raw-id: //depot/perl@16615 --- diff --git a/ext/Storable/t/downgrade.t b/ext/Storable/t/downgrade.t index bbdf4dc..b560508 100644 --- a/ext/Storable/t/downgrade.t +++ b/ext/Storable/t/downgrade.t @@ -39,10 +39,21 @@ use vars qw(@RESTRICT_TESTS %R_HASH %U_HASH $UTF8_CROAK $RESTRICTED_CROAK); %R_HASH = (perl => 'rules'); if ($] >= 5.007003) { + # This is cheating. "\xdf" in Latin 1 is beta S, so will match \w if it + # is stored in utf8, not bytes. + # "\xdf" is y diaresis in EBCDIC (except for cp875, but so far no-one seems + # to use that) which has exactly the same properties for \w + # So the tests happen to pass. my $utf8 = "Schlo\xdf" . chr 256; chop $utf8; - %U_HASH = (map {$_, $_} 'castle', "ch\xe5teau", $utf8, chr 0x57CE); + # \xe5 is V in EBCDIC. That doesn't have the same properties w.r.t. \w as + # an a circumflex, so we need to be explicit. + + # and its these very properties we're trying to test - an edge case + # involving whether scalars are being stored in bytes or in utf8. + my $a_circumflex = (ord ('A') == 193 ? "\x47" : "\xe5"); + %U_HASH = (map {$_, $_} 'castle', "ch${a_circumflex}teau", $utf8, chr 0x57CE); plan tests => 169; } elsif ($] >= 5.006) { plan tests => 59; @@ -397,7 +408,7 @@ begin 301 Short 8 bit utf8 data as bytes end begin 301 Long 8 bit utf8 data -M!04!```"`(MSBW.+#B.6CA8&D``````>#B.6C -FA8&D"@?B@XB3EHMS`@````;B@XB3EM\*!-QD#B.6CA8&D``````>#B.6C +M!049``````0*!H.!HJ.3A0`````&@X&BHY.%"@>#B$>CA8&D``````>#B$>C FA8&D%P?B@XB3EHMS`@````;B@XB3EM\7!-QD