writing to the root directory requires elevated privileges
authorTony Cook <tony@develop-help.com>
Mon, 22 Jul 2019 05:45:39 +0000 (15:45 +1000)
committerTony Cook <tony@develop-help.com>
Mon, 22 Jul 2019 05:45:39 +0000 (15:45 +1000)
on modern Win32, and testing might be done without such elevation.

I'll re-indent in the next commit

ext/File-Find/t/find.t

index b0e30eb..bca797e 100644 (file)
@@ -1026,11 +1026,13 @@ if ($^O eq 'MSWin32') {
         }
     }
     closedir $ROOT_DIR;
+  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 die "cannot create file in root directory: $!\n";
+            or skip "cannot create file in root directory: $!", 8;
         $created_file = 1;
     }
 
@@ -1067,6 +1069,7 @@ if ($^O eq 'MSWin32') {
         unlink("/$expected_first_file")
             or warn "can't unlink /$expected_first_file: $!\n";
     }
+    }
 }
 
 {