From: Vincent Pit Date: Fri, 21 Jan 2011 11:16:26 +0000 (+0100) Subject: Directly test the truth of $ok in ok() X-Git-Tag: v0.03~16 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=bc94fb7770772cf212e7d3d4f6ef8a2cd69a290d;p=perl%2Fmodules%2FTest-Leaner.git Directly test the truth of $ok in ok() --- diff --git a/lib/Test/Leaner.pm b/lib/Test/Leaner.pm index 2ada203..b07fbca 100644 --- a/lib/Test/Leaner.pm +++ b/lib/Test/Leaner.pm @@ -408,10 +408,10 @@ sub ok ($;$) { ++$test; my $test_str = "ok $test"; - unless ($ok) { + $ok or do { $test_str = "not $test_str"; ++$failed; - } + }; if (defined $desc) { _sanitize_comment($desc); $test_str .= " - $desc" if length $desc;