Subject: | Bad test count message should state actual count |
When the number of tests executed differs from the expected, we get a message such as
# Looks like you planned 9 tests but ran 5 extra.
That's fine until you start doing comprehensive large-scale testing, where the actual tests to do are determined automatically, but you still want to plan the number, in case something that is determining which things to test goes wrong.
I do this in a couple of cases, most notably Test::ClassAPI.
After I've noted API changes for the new version, I run the test suite, note the change in test number, then update the plan declaration.
I can add 9 + 4 in my head just fine, but when this starts to happen
# Looks like you planned 929 tests but ran 576 extra.
it gets a little more annoying.
I propose you change the message at
Test::Builder::_ending(/usr/lib/perl5/5.8.0/Test/Builder.pm:1338):
1338: $self->diag(<<"FAIL");
1339: Looks like you planned $Expected_Tests tests but ran $num_extra extra.
1340: FAIL
with something like
"Looks like you planned $Expected_Tests tests but ran $num_extra extra ($Curr_Test)"
or
"Looks like you planned $Expected_Tests tests but actually ran $Curr_Test ($num_extra extra)"
And I would assume the negative case should be changed as well.
Regardless, you should mention the actual number as a conveniece, for the times when the 'ok xxx' lines arn't shown.