X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=ext%2FEncode%2Ft%2Fenc_eucjp.t;h=3d5457d54f05b702bf83b920ec2b6e972b1483b9;hb=8676e7d322bcb9ce4010d380a2367dc55cf6a6de;hp=019b42606fb7e0670bf882f3ae7dff2b6b81dbcf;hpb=88632417a970dff8f92718b0800b1aa1400cb4ae;p=p5sagit%2Fp5-mst-13.2.git diff --git a/ext/Encode/t/enc_eucjp.t b/ext/Encode/t/enc_eucjp.t index 019b426..3d5457d 100644 --- a/ext/Encode/t/enc_eucjp.t +++ b/ext/Encode/t/enc_eucjp.t @@ -1,5 +1,5 @@ -# This is the twin of enc_utf8.t, the only difference is that -# this has "use encoding 'euc-jp'". +# $Id: enc_eucjp.t,v 1.4 2003/04/24 17:43:16 dankogai Exp $ +# This is the twin of enc_utf8.t . BEGIN { require Config; import Config; @@ -15,6 +15,10 @@ BEGIN { print "1..0 # encoding pragma does not support EBCDIC platforms\n"; exit(0); } + if ($] <= 5.008 and !$Config{perl_patchlevel}){ + print "1..0 # Skip: Perl 5.8.1 or later required\n"; + exit 0; + } } use encoding 'euc-jp'; @@ -26,10 +30,12 @@ print "1.." . (scalar @c + 1) . "\n"; my @f; for my $i (0..$#c) { + no warnings 'pack'; push @f, "f$i"; open(F, ">f$i") or die "$0: failed to open 'f$i' for writing: $!"; binmode(F, ":utf8"); print F chr($c[$i]); + print F pack("C" => $c[$i]); close F; } @@ -58,6 +64,7 @@ binmode(F, ":encoding(utf-8)"); local $SIG{__WARN__} = sub { $a = shift }; eval { }; # This should get caught. } +close F; print $a =~ qr{^utf8 "\\x80" does not map to Unicode} ? "ok $t - illegal utf8 input\n" : "not ok $t - illegal utf8 input: a = " . unpack("H*", $a) . "\n";