From 0dc941edef7722e711d8dec55166524a21ef13d2 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Sat, 6 Apr 2013 13:01:54 -0600 Subject: [PATCH] t/op/utfhash.t: Fix to work on EBCDIC 1047 This .t thought it could have an __END__ in the middle of DATA input, and the first read would read in up to that, and the second would read the rest. In bisecting, I couldn't find a time when this ever worked. Now this has a marker, and does a split on that marker, choosing the first or second half depending. Note that this only works on ASCII and EBCDIC 1047 platforms. It could be extended for the other code pages Perl purportedly supports. --- t/op/utfhash.t | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/t/op/utfhash.t b/t/op/utfhash.t index 2f1b688..5200c5b 100644 --- a/t/op/utfhash.t +++ b/t/op/utfhash.t @@ -176,13 +176,10 @@ foreach ("\x7f","\xff") { local $/; # Slurp. - my $utf8 = ; - my $utfebcdic = ; - if (ord('A') == 65) { - eval $utf8; - } elsif (ord('A') == 193) { - eval $utfebcdic; - } + my $data = ; + my ($utf8, $utf1047ebcdic) = split /__SPLIT__/, $data; + $utf8 = $utf1047ebcdic if $::IS_EBCDIC; + eval $utf8; } __END__ { @@ -203,8 +200,8 @@ __END__ ok !utf8::is_utf8($key), "'$key' shouldn't have utf8 flag"; } } -__END__ -{ +__SPLIT__ +{ # This is 1047 UTF-EBCDIC; won't work on other code pages. # See if utf8 barewords work [perl #22969] use utf8; # UTF-EBCDIC, really. my %hash = (½ää½âÀ½äâ½ää => 123); -- 1.8.3.1