diff options
author | Craig A. Berry <craigberry@mac.com> | 2017-01-14 15:44:15 -0600 |
---|---|---|
committer | Craig A. Berry <craigberry@mac.com> | 2017-01-14 16:33:43 -0600 |
commit | 4767d89388527b747495568a327247ba5b9c72bf (patch) | |
tree | adc98209415fac8491087a2dac606549d1a88c58 | |
parent | 1d86dd2f9a6c95dbe3230acac995ec2205513b0d (diff) | |
download | perl-4767d89388527b747495568a327247ba5b9c72bf.tar.gz |
Use File::Spec->catfile() in Test2's Files.t test.
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.
-rwxr-xr-x | Porting/Maintainers.pl | 4 | ||||
-rw-r--r-- | cpan/Test-Simple/t/Test2/modules/IPC/Driver/Files.t | 8 | ||||
-rw-r--r-- | t/porting/customized.dat | 1 |
3 files changed, 10 insertions, 3 deletions
diff --git a/Porting/Maintainers.pl b/Porting/Maintainers.pl index 2b72707d4a..b6fed8b15a 100755 --- a/Porting/Maintainers.pl +++ b/Porting/Maintainers.pl @@ -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' => { diff --git a/cpan/Test-Simple/t/Test2/modules/IPC/Driver/Files.t b/cpan/Test-Simple/t/Test2/modules/IPC/Driver/Files.t index 0e79101d51..367d0ef6a0 100644 --- a/cpan/Test-Simple/t/Test2/modules/IPC/Driver/Files.t +++ b/cpan/Test-Simple/t/Test2/modules/IPC/Driver/Files.t @@ -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->(); diff --git a/t/porting/customized.dat b/t/porting/customized.dat index a2a953a36a..24df433f99 100644 --- a/t/porting/customized.dat +++ b/t/porting/customized.dat @@ -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 |