This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
amigaos4: implement flock() emulation
[perl5.git] / t / io / perlio_leaks.t
CommitLineData
2556f95e
GF
1#!perl
2# ioleaks.t
3
0214bff6
RGS
4BEGIN {
5 chdir 't' if -d 't';
6 @INC = '../lib';
7 require './test.pl';
8}
9
2556f95e
GF
10use strict;
11use warnings;
0214bff6 12plan 'no_plan';
2556f95e
GF
13
14# :unix -> not ok
15# :stdio -> not ok
16# :perlio -> ok
17# :crlf -> ok
18
2376d97d 19TODO: {
2376d97d
SP
20 foreach my $layer(qw(:unix :stdio :perlio :crlf)){
21 my $base_fd = do{ open my $in, '<', $0 or die $!; fileno $in };
2556f95e 22
2376d97d 23 for(1 .. 3){
0214bff6 24 local $::TODO;
776e8d8c 25 if ($_ > 1 && $layer =~ /^:(unix|stdio)$/) {
0214bff6 26 $::TODO = "[perl #56644] PerlIO resource leaks on open() and then :pop in :unix and :stdio"
776e8d8c
DM
27 }
28 open my $fh, "<$layer", $0 or die $!;
2556f95e 29
776e8d8c
DM
30 is fileno($fh), $base_fd, $layer;
31 binmode $fh, ':pop';
2376d97d
SP
32 }
33 }
2556f95e
GF
34}
35