[Koha-devel] Test: planned count or done_testing()

Jonathan Druart jonathan.druart at bugs.koha-community.org
Sun Nov 26 18:49:36 CET 2017


I do not think it's a good idea, it can hide bugs [examples needed]

> We can always add a count where we really want it.

When do you know it is needed? :)

We could also use
use Test::More plan => $number_of_tests;
BEGIN{ $number_of_tests += 1 };
subtest "first subtest" => sub { ok(); }
BEGIN{ $number_of_tests += 1 };
subtest "second subtest" => sub { ok(); }

But I am not a fan of this but we avoid useless conflicts and keep the plan.

refs:
- https://perlmaven.com/done-testing
-
https://stackoverflow.com/questions/690342/why-do-i-need-to-know-how-many-tests-i-will-be-running-with-testmore/692393
(best
answer disagrees with me)

Cheers,
Jonathan

On Wed, 15 Nov 2017 at 11:18 Marcel de Rooy <M.de.Rooy at rijksmuseum.nl>
wrote:

> Less strict, but more pragmatic.
>
> I think we spend more time on rebasing test counts than we will probably
> spend on checking tests that passed but should have failed on counts. We
> can always add a count where we really want it.
>
> No objection from me.
>
> _______________________________________________
> Koha-devel mailing list
> Koha-devel at lists.koha-community.org
> http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
> website : http://www.koha-community.org/
> git : http://git.koha-community.org/
> bugs : http://bugs.koha-community.org/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.koha-community.org/pipermail/koha-devel/attachments/20171126/8033ee1a/attachment.html>


More information about the Koha-devel mailing list