(was Re: PerlIO regerssion tests?)
[p5sagit/p5-mst-13.2.git] / t / io / utf8.t
index a541030..1a7d27f 100755 (executable)
@@ -9,7 +9,7 @@ BEGIN {
     }
 }
 
-no utf8; # so that the naked 8-bit chars won't gripe under use utf8
+no utf8; # needed for use utf8 not griping about the raw octets
 
 $| = 1;
 my $total_tests = 25;
@@ -138,7 +138,11 @@ print "ok 21\n";
 # Now let's make it suffer.
 open F, ">", "a" or die $!;
 my $w;
-eval {local $SIG{__WARN__} = sub { $w = $_[0] };  print F $a; };
+{
+    use warnings 'utf8';
+    local $SIG{__WARN__} = sub { $w = $_[0] };
+    print F $a;
+}
 print "not " if ($@ || $w !~ /Wide character in print/i);
 print "ok 22\n";
 }
@@ -177,5 +181,6 @@ $x = <F>; chomp $x;
 eval { sprintf "%vd\n", $x; }
 }
 
+close F;
 unlink('a');