Test-More / test-more

Test2, Test::More, Test::Simple and Test::Builder Perl modules for writing tests
Other
140 stars 87 forks source link

done_testing() ignores its arguments #978

Open schwern opened 8 years ago

schwern commented 8 years ago

@petdance noticed that done_testing ignores its arguments.

$ perl -wle 'use Test2::Bundle::Extended; pass(); done_testing(12)'
# Seeded srand with seed '20160915' from local date.
ok 1
1..1

This contradicts how Test::More behaves.

$ perl -wle 'use Test::More; pass(); done_testing(12)'
ok 1
1..12
# Looks like you planned 12 tests but ran 1.

At minimum done_testing should error instead of ignoring arguments.

I'd like to see the Test::More feature reinstated, people like their fixed plans for some reason, but @exodist says he has reasons not to and will comment.

schwern commented 8 years ago

@petdance's original example used Test2::Bundle::More. Since that "is intended to be a (mostly) drop-in replacement for Test::More", it should support done_testing arguments as Test::More does. It looks like nothing more than...

sub done_testing {
    plan(shift) if @_;
    _real_done_testing();
}