In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/3df2ec53a8bebf2834a6148ee2f3453fdc73fd66?hp=3857d07c85882fa81d5e5c1ce2867e8c957747d0>
- Log ----------------------------------------------------------------- commit 3df2ec53a8bebf2834a6148ee2f3453fdc73fd66 Author: Nicholas Clark <[email protected]> Date: Fri Feb 4 16:59:42 2011 +0000 Actually generate full failure diagnostics in checkErrs() in B's OptreeCheck, 3857d07c85882fa8 used if() where unless() would have been correct. However, I didn't spot this because a: none of the tests fail so none are trying to generate diagnostics b: the code as written is silent if there are no errors Hence make the code be called unconditionally, which simplifies things. Remove the vestigial forced fail() if $gOpts{fail} is true. ----------------------------------------------------------------------- Summary of changes: ext/B/t/OptreeCheck.pm | 15 +++++++-------- 1 files changed, 7 insertions(+), 8 deletions(-) diff --git a/ext/B/t/OptreeCheck.pm b/ext/B/t/OptreeCheck.pm index 4bbe32b..8cb97b9 100644 --- a/ext/B/t/OptreeCheck.pm +++ b/ext/B/t/OptreeCheck.pm @@ -556,15 +556,14 @@ sub checkErrs { @missed = sort @missed; my @got = sort keys %goterrs; - if (@{$tc->{errs}} - ? is(@missed + @got, 0, "Only got expected errors for $tc->{name}") - : is(scalar @got, 0, "Got no errors for $tc->{name}") # @missed must be 0 here. - ) { - _diag(join "\n", "got unexpected:", @got) if @got; - _diag(join "\n", "missed expected:", @missed) if @missed; + if (@{$tc->{errs}}) { + is(@missed + @got, 0, "Only got expected errors for $tc->{name}") + } else { + # @missed must be 0 here. + is(scalar @got, 0, "Got no errors for $tc->{name}") } - - fail("FORCED: $tc->{name}:\n") if $gOpts{fail}; # silly ? + _diag(join "\n", "got unexpected:", @got) if @got; + _diag(join "\n", "missed expected:", @missed) if @missed; } =head1 mkCheckRex ($tc) -- Perl5 Master Repository
