Make unicode semantics the default
[p5sagit/p5-mst-13.2.git] / t / io / perlio_leaks.t
index ad76c39..a7cdf28 100644 (file)
@@ -1,9 +1,15 @@
 #!perl
 # ioleaks.t
 
+BEGIN {
+    chdir 't' if -d 't';
+    @INC = '../lib';
+    require './test.pl';
+}
+
 use strict;
 use warnings;
-use Test::More 'no_plan';
+plan 'no_plan';
 
 # :unix   -> not ok
 # :stdio  -> not ok
@@ -11,15 +17,18 @@ use Test::More 'no_plan';
 # :crlf   -> ok
 
 TODO: {
-    local $TODO = "[perl #56644] PerlIO resource leaks on open() and then :pop in :unix and :stdio";
     foreach my $layer(qw(:unix :stdio  :perlio :crlf)){
         my $base_fd = do{ open my $in, '<', $0 or die $!; fileno $in };
 
         for(1 .. 3){
-                open my $fh, "<$layer", $0 or die $!;
+           local $::TODO;
+           if ($_ > 1 && $layer =~ /^:(unix|stdio)$/) {
+               $::TODO = "[perl #56644] PerlIO resource leaks on open() and then :pop in :unix and :stdio"
+           }
+           open my $fh, "<$layer", $0 or die $!;
 
-                is fileno($fh), $base_fd, $layer;
-                binmode $fh, ':pop';
+           is fileno($fh), $base_fd, $layer;
+           binmode $fh, ':pop';
         }
     }
 }