Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
31 lines (22 sloc) 534 Bytes
#!perl -w
use strict;
use Test::More;
if($] < 5.008_008){
plan skip_all => "Version $] of PerlIO has a bug on invalid filehandle";
plan tests => 9;
use PerlIO::Util;
# make empty IO
open my $invalid, '+<', \'';
1 while $invalid->pop_layer();
like $invalid->inspect, qr/Invalid filehandle/, 'setup invalid filehandle';
foreach my $l qw(:flock :creat :excl :tee :dir :reverse :fse){
no warnings 'layer';
ok !binmode($invalid, $l), $l;
1 while $invalid->pop_layer();
ok !close($invalid), 'close';