From: Vincent Pit Date: Fri, 30 Oct 2015 15:10:33 +0000 (-0200) Subject: No "unless else" please X-Git-Tag: v1.15~6 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=b5294ed53dd1c663331ed4093df805368b7e5dde;p=perl%2Fmodules%2FTest-Valgrind.git No "unless else" please --- diff --git a/lib/Test/Valgrind/Action/Suppressions.pm b/lib/Test/Valgrind/Action/Suppressions.pm index 3fe2d22..f35e27e 100644 --- a/lib/Test/Valgrind/Action/Suppressions.pm +++ b/lib/Test/Valgrind/Action/Suppressions.pm @@ -145,11 +145,11 @@ sub finish { 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 diff --git a/lib/Test/Valgrind/Command/Perl.pm b/lib/Test/Valgrind/Command/Perl.pm index 3d30634..fd55aac 100644 --- a/lib/Test/Valgrind/Command/Perl.pm +++ b/lib/Test/Valgrind/Command/Perl.pm @@ -260,11 +260,11 @@ eval { 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;