Upgrade to Encode 1.93.
[p5sagit/p5-mst-13.2.git] / ext / Encode / t / enc_eucjp.t
index 8bc1f4d..3d5457d 100644 (file)
@@ -1,12 +1,7 @@
-# $Id: enc_eucjp.t,v 1.1 2003/01/21 22:19:14 dankogai Exp $
-# 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 {
-    if ($] <= 5.008){
-       print "1..0 # Skip: Perl 5.8.1 or later required\n";
-       exit 0;
-    }
     require Config; import Config;
     if ($Config{'extensions'} !~ /\bEncode\b/) {
       print "1..0 # Skip: Encode was not built\n";
@@ -20,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';
@@ -31,6 +30,7 @@ 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");
@@ -64,6 +64,7 @@ binmode(F, ":encoding(utf-8)");
        local $SIG{__WARN__} = sub { $a = shift };
        eval { <F> }; # 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";