mirror of
https://github.com/Perl/perl5.git
synced 2026-01-26 08:38:23 +00:00
Use set_up_inc when require.pl is loaded move plan outside of BEGIN block when no tests are run at BEGIN time. Using set_up_inc allow to run these tests under minitest but also compile them using B::C. This also has the advantage to use a single control point for @INC setup. Note: some tests cannot use 'require test.pl', unshfit is then used for them.
36 lines
680 B
Perl
36 lines
680 B
Perl
#!perl
|
|
# ioleaks.t
|
|
|
|
BEGIN {
|
|
chdir 't' if -d 't';
|
|
require './test.pl';
|
|
set_up_inc('../lib');
|
|
}
|
|
|
|
use strict;
|
|
use warnings;
|
|
plan 'no_plan';
|
|
|
|
# :unix -> not ok
|
|
# :stdio -> not ok
|
|
# :perlio -> ok
|
|
# :crlf -> ok
|
|
|
|
TODO: {
|
|
foreach my $layer(qw(:unix :stdio :perlio :crlf)){
|
|
my $base_fd = do{ open my $in, '<', $0 or die $!; fileno $in };
|
|
|
|
for(1 .. 3){
|
|
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';
|
|
}
|
|
}
|
|
}
|
|
|