summaryrefslogtreecommitdiff
path: root/t/io/perlio_leaks.t
diff options
context:
space:
mode:
Diffstat (limited to 't/io/perlio_leaks.t')
-rw-r--r--t/io/perlio_leaks.t26
1 files changed, 26 insertions, 0 deletions
diff --git a/t/io/perlio_leaks.t b/t/io/perlio_leaks.t
new file mode 100644
index 0000000000..ad76c39e9e
--- /dev/null
+++ b/t/io/perlio_leaks.t
@@ -0,0 +1,26 @@
+#!perl
+# ioleaks.t
+
+use strict;
+use warnings;
+use Test::More 'no_plan';
+
+# :unix -> not ok
+# :stdio -> not ok
+# :perlio -> ok
+# :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 $!;
+
+ is fileno($fh), $base_fd, $layer;
+ binmode $fh, ':pop';
+ }
+ }
+}
+