In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/cfb8d85df6ebf8495bf2f9a43a9b70bf0ccb37fd?hp=e3f4f321290813be202cfd9ce45f4ef5b3d96a2f>

- Log -----------------------------------------------------------------
-----------------------------------------------------------------------

Summary of changes:
 ext/File-Find/t/find.t | 77 ++++++++++++++++++++++++++------------------------
 1 file changed, 40 insertions(+), 37 deletions(-)

diff --git a/ext/File-Find/t/find.t b/ext/File-Find/t/find.t
index b0e30eb478..0a7355296c 100644
--- a/ext/File-Find/t/find.t
+++ b/ext/File-Find/t/find.t
@@ -1026,46 +1026,49 @@ if ($^O eq 'MSWin32') {
         }
     }
     closedir $ROOT_DIR;
-    my $created_file;
-    unless (defined $expected_first_file) {
-        $expected_first_file = '__perl_File_Find_test.tmp';
-        open(F, ">", "/$expected_first_file") && close(F)
-            or die "cannot create file in root directory: $!\n";
-        $created_file = 1;
-    }
+  SKIP:
+    {
+        my $created_file;
+        unless (defined $expected_first_file) {
+            $expected_first_file = '__perl_File_Find_test.tmp';
+            open(F, ">", "/$expected_first_file") && close(F)
+                or skip "cannot create file in root directory: $!", 8;
+            $created_file = 1;
+        }
 
-    # Run F:F:f with/without no_chdir for each possible style of root path.
-    # NB. If HOME were "/", then an inadvertent chdir('') would fluke the
-    # expected result, so ensure it is something else:
-    local $ENV{HOME} = $orig_dir;
-    foreach my $no_chdir (0, 1) {
-        foreach my $root_dir ("/", "\\", "$drive/", "$drive\\") {
-            eval {
-                File::Find::find({
-                    'no_chdir' => $no_chdir,
-                    'preprocess' => sub { return sort @_ },
-                    'wanted' => sub {
-                        -f or return; # the first call is for $root_dir itself.
-                        my $got = $File::Find::name;
-                        my $exp = "$root_dir$expected_first_file";
-                        print "# no_chdir=$no_chdir $root_dir '$got'\n";
-                        is($got, $exp,
-                            "Win32: Run 'find' with 'no_chdir' set to 
$no_chdir" );
-                        die "done"; # do not process the entire drive!
-                    },
-                }, $root_dir);
-            };
-            # If F:F:f did not die "done" then it did not Check() either.
-            unless ($@ and $@ =~ /done/) {
-                print "# no_chdir=$no_chdir $root_dir ",
-                    ($@ ? "error: $@" : "no files found"), "\n";
-                ok(0, "Win32: 0");
+        # Run F:F:f with/without no_chdir for each possible style of root path.
+        # NB. If HOME were "/", then an inadvertent chdir('') would fluke the
+        # expected result, so ensure it is something else:
+        local $ENV{HOME} = $orig_dir;
+        foreach my $no_chdir (0, 1) {
+            foreach my $root_dir ("/", "\\", "$drive/", "$drive\\") {
+                eval {
+                    File::Find::find({
+                        'no_chdir' => $no_chdir,
+                            'preprocess' => sub { return sort @_ },
+                            'wanted' => sub {
+                                -f or return; # the first call is for 
$root_dir itself.
+                                my $got = $File::Find::name;
+                                my $exp = "$root_dir$expected_first_file";
+                                print "# no_chdir=$no_chdir $root_dir 
'$got'\n";
+                                is($got, $exp,
+                                   "Win32: Run 'find' with 'no_chdir' set to 
$no_chdir" );
+                                die "done"; # do not process the entire drive!
+                        },
+                    }, $root_dir);
+                };
+                # If F:F:f did not die "done" then it did not Check() either.
+                unless ($@ and $@ =~ /done/) {
+                    print "# no_chdir=$no_chdir $root_dir ",
+                        ($@ ? "error: $@" : "no files found"), "\n";
+                    ok(0, "Win32: 0");
+                }
             }
         }
-    }
-    if ($created_file) {
-        unlink("/$expected_first_file")
-            or warn "can't unlink /$expected_first_file: $!\n";
+        if ($created_file) {
+            unlink("/$expected_first_file")
+                or warn "can't unlink /$expected_first_file: $!\n";
+        }
     }
 }
 

-- 
Perl5 Master Repository

Reply via email to