This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
fetch magic on the first stacked filetest, not the last
[perl5.git] / t / op / filetest.t
index fe9724c..7c471c0 100644 (file)
@@ -9,7 +9,7 @@ BEGIN {
     set_up_inc(qw '../lib ../cpan/Perl-OSType/lib');
 }
 
-plan(tests => 57 + 27*14);
+plan(tests => 58 + 27*14);
 
 if ($^O =~ /MSWin32|cygwin|msys/ && !is_miniperl) {
   require Win32; # for IsAdminUser()
@@ -385,3 +385,11 @@ SKIP: {
     ok(!-f "TEST\0-", '-f on name with \0');
     ok(!-r "TEST\0-", '-r on name with \0');
 }
+
+{
+    # github #18293
+    "" =~ /(.*)/;
+    my $x = $1; # call magic on $1, setting the pv to ""
+    "test.pl" =~ /(.*)/;
+    ok(-f -r $1, "stacked handles on a name with magic");
+}