summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--t/lib/warnings/doio26
1 files changed, 20 insertions, 6 deletions
diff --git a/t/lib/warnings/doio b/t/lib/warnings/doio
index bf0cd780c1..63250e156c 100644
--- a/t/lib/warnings/doio
+++ b/t/lib/warnings/doio
@@ -209,31 +209,45 @@ EXPECT
########
# doio.c [Perl_nextargv]
$^W = 0 ;
+# These happen to warn at different points within doio.c
+# This will open read only, and then be caught by an explicit check:
my $filename = "./temp.dir" ;
+# Whereas these two will fail to open:
+my $dir0 = "./zero.dir" ;
+# but files and directories have a different error message if they don't open:
+my $file3 = "date|" ;
mkdir $filename, 0777
or die "Cannot create directory $filename: $!\n" ;
+mkdir $dir0, 0
+ or die "Cannot create directory dir0: $!\n" ;
{
- local (@ARGV) = ($filename) ;
+ local (@ARGV) = ($filename, $dir0, $file3) ;
local ($^I) = "" ;
my $x = <> ;
}
{
no warnings 'inplace' ;
- local (@ARGV) = ($filename) ;
+ local (@ARGV) = ($filename, $dir0, $file3) ;
local ($^I) = "" ;
my $x = <> ;
}
{
use warnings 'inplace' ;
- local (@ARGV) = ($filename) ;
+ local (@ARGV) = ($filename, $dir0, $file3) ;
local ($^I) = "" ;
my $x = <> ;
}
rmdir $filename ;
+chmod 0777, $dir0 ;
+rmdir $dir0 ;
EXPECT
-Can't do inplace edit: ./temp.dir is not a regular file at - line 9.
-Can't do inplace edit: ./temp.dir is not a regular file at - line 21.
-
+OPTION regex
+Can't do inplace edit: \./temp\.dir is not a regular file at - line 17\.
+Can't do inplace edit: \./zero\.dir is not a regular file at - line 17\.
+Can't open date\|: .*? at - line 17\.
+Can't do inplace edit: \./temp\.dir is not a regular file at - line 29\.
+Can't do inplace edit: \./zero\.dir is not a regular file at - line 29\.
+Can't open date\|: .*? at - line 29\.
########
# doio.c [Perl_do_eof]
use warnings 'io' ;