summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad Gilbert <b2gills@gmail.com>2010-12-07 17:16:56 -0600
committerFather Chrysostomos <sprout@cpan.org>2010-12-08 11:17:35 -0800
commit55b0687d8bc1aa7e911b5fd2678ea7e8dbe6f059 (patch)
tree0ead22809e28c21de7932d3bac77e851972a6714
parent96fedf7b439670394f9a08f3e777580fd85ef6cf (diff)
downloadperl-55b0687d8bc1aa7e911b5fd2678ea7e8dbe6f059.tar.gz
Modified unlink_all in t/test.pl to return the count of unlinked files This will make it so that it can be a drop-in replacement for unlink
-rw-r--r--t/test.pl8
1 files changed, 7 insertions, 1 deletions
diff --git a/t/test.pl b/t/test.pl
index bfda110e80..a55882003f 100644
--- a/t/test.pl
+++ b/t/test.pl
@@ -630,10 +630,16 @@ sub which_perl {
}
sub unlink_all {
+ my $count = 0;
foreach my $file (@_) {
1 while unlink $file;
- _print_stderr "# Couldn't unlink '$file': $!\n" if -f $file;
+ if( -f $file ){
+ _print_stderr "# Couldn't unlink '$file': $!\n";
+ }else{
+ ++$count;
+ }
}
+ $count;
}
my %tmpfiles;