require File::Spec;
my ($vol, $dir, $file) = File::Spec->splitpath($target);
my $base = File::Spec->catpath($vol, $dir, '');
- unless (-e $base) {
+ if (-e $base) {
+ 1 while unlink $target;
+ } else {
require File::Path;
File::Path::mkpath([ $base ]);
- } else {
- 1 while unlink $target;
}
open my $fh, '>', $target
XSLoader::load('Test::Valgrind', $Test::Valgrind::VERSION);
};
-unless ($@) {
- Test::Valgrind::notleak("valgrind it!");
-} else {
+if ($@) {
diag $@;
*Test::Valgrind::DEBUGGING = sub { 'unknown' };
+} else {
+ Test::Valgrind::notleak("valgrind it!");
}
plan tests => 1;