lundi 21 septembre 2020

Is there any way to check if done_testing has been called in Test::More?

Suppose that we have a subroutine in a class derived from Test::More that performs a series of tests, and eventually calls done_testing. Is there a way to check if it's been called before so that it does not error if it's called again, or simply stop testing if that's the case? I know it's probably better if we wrap all tests called in that subroutine in a subtest which calls done_testing implicitly, but in any case, I'm curious about the question. Looking at its source, there's apparently a meta variable you can check, but that's undocumented and probably not part of the public API, is that correct?

Aucun commentaire:

Enregistrer un commentaire