diff options
Diffstat (limited to 't/basic.t')
-rw-r--r-- | t/basic.t | 18 |
1 files changed, 15 insertions, 3 deletions
@@ -15,9 +15,12 @@ foreach my $func (qw( socket socketpair bind connect listen accept shutdown getsockopt setsockopt getsockname getpeername truncate chdir pipe )) { - eval "sub { no bareword::filehandles; $func BAREWORD }"; - $@ =~ s/-([oO])/"-".chr(ord($1)^0x20)/e if "$]" < 5.008008; # workaround Perl RT#36672 - like "$@", qr/^Use of bareword filehandle in \Q$func\E\b/, "$func BAREWORD dies"; + SKIP: { + skip "Can't check filetest '$func' on Perl < 5.31.1", 1 if "$]" < 5.031001 and $func =~ /\A-.\z/; + eval "sub { no bareword::filehandles; $func BAREWORD }"; + $@ =~ s/-([oO])/"-".chr(ord($1)^0x20)/e if "$]" < 5.008008; # workaround Perl RT#36672 + like "$@", qr/^Use of bareword filehandle in \Q$func\E\b/, "$func BAREWORD dies"; + } foreach my $fh ("", qw(STDIN STDERR STDOUT DATA ARGV)) { eval "sub { no bareword::filehandles; $func $fh }"; unlike "$@", qr/Use of bareword filehandle/, "$func $fh lives"; @@ -29,5 +32,14 @@ foreach my $func (qw(accept pipe socketpair)) { like "$@", qr/^Use of bareword filehandle in \Q$func\E\b/, "$func my \$fh, BAREWORD dies"; } + +SKIP: { + skip "no stacked file tests on perl $]", 2 if "$]" < 5.010; + my $warnings = ''; + local $SIG{__WARN__} = sub { $warnings .= $_[0] }; + ok -d -e ".", "stacked file test works"; + is $warnings, '', "no warnings for stacked file test"; +}; + done_testing; |