diff options
author | Nicholas Clark <nick@ccl4.org> | 2011-02-04 16:59:42 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2011-02-04 16:59:42 +0000 |
commit | 3df2ec53a8bebf2834a6148ee2f3453fdc73fd66 (patch) | |
tree | a0d1b21afd135fb29d931bafa7d7c0e295d04707 /ext | |
parent | 3857d07c85882fa81d5e5c1ce2867e8c957747d0 (diff) | |
download | perl-3df2ec53a8bebf2834a6148ee2f3453fdc73fd66.tar.gz |
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.
Diffstat (limited to 'ext')
-rw-r--r-- | 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 4bbe32b5fa..8cb97b91ac 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) |