Use File::Spec->catfile() in Test2's Files.t test.
authorCraig A. Berry <craigberry@mac.com>
Sat, 14 Jan 2017 21:44:15 +0000 (15:44 -0600)
committerCraig A. Berry <craigberry@mac.com>
Sat, 14 Jan 2017 22:33:43 +0000 (16:33 -0600)
Explicitly using forward slashes to concatenate filenames is not
portable and we've already loaded File::Spec anyway.  Also, don't
try to remove the directory we're cleaning up unless we were
successful in opening it.

Porting/Maintainers.pl
cpan/Test-Simple/t/Test2/modules/IPC/Driver/Files.t
t/porting/customized.dat

index 2b72707..b6fed8b 100755 (executable)
@@ -1178,6 +1178,10 @@ use File::Glob qw(:case);
                 t/zzz-check-breaks.t
                 ),
         ],
+        'CUSTOMIZED'   => [
+            #
+            qw( t/Test2/modules/IPC/Driver/Files.t )
+        ],
     },
 
     'Text::Abbrev' => {
index 0e79101..367d0ef 100644 (file)
@@ -160,11 +160,13 @@ ok(!-d $tmpdir, "cleaned up temp dir");
         if (opendir(my $d, $tmpdir)) {
             for my $f (readdir($d)) {
                 next if $f =~ m/^\.+$/;
-                next unless -f "$tmpdir/$f";
-                unlink("$tmpdir/$f");
+                my $file = File::Spec->catfile($tmpdir, $f);
+                next unless -f $file;
+                1 while unlink $file;
             }
+            closedir($d);
+            rmdir($tmpdir) or warn "Could not remove temp dir '$tmpdir': $!";
         }
-        rmdir($tmpdir) or warn "Could not remove temp dir '$tmpdir': $!";
     };
     $cleanup->();
 
index a2a953a..24df433 100644 (file)
@@ -107,6 +107,7 @@ Test::Harness cpan/Test-Harness/lib/TAP/Parser/SourceHandler/RawTAP.pm d01e1e2a8
 Test::Harness cpan/Test-Harness/lib/TAP/Parser/YAMLish/Reader.pm 76771092dd2b87a2adb7ff20b7ae77cbae7d0563
 Test::Harness cpan/Test-Harness/lib/TAP/Parser/YAMLish/Writer.pm bf1fbfff9720330886651f183959a5db56daeea0
 Test::Harness cpan/Test-Harness/lib/Test/Harness.pm da2d76ba673372da129060c9d0adb8cf0d91f9f7
+Test::Simple cpan/Test-Simple/t/Test2/modules/IPC/Driver/Files.t 59648b5745fda06177d81c2c21f55b09f6e129bb
 autodie cpan/autodie/t/mkdir.t 9e70d2282a3cc7d76a78bf8144fccba20fb37dac
 base dist/base/lib/base.pm 9575442273694d41c8e86cb1d86fa1935a07c8a8
 version cpan/version/lib/version.pm a032a751524bdd07a93c945d2a1703abe7ad8ef0