Hello everyone,

I have come up with an alternative to specifying the number of tests while still verifying that they all execute properly. It is my understanding that the main benefit to taking the time to specify a plan is to verify nothing funky happened before all the tests were executed that resulted in the test being halted in the middle of a run. However, without a failure being encountered the test will pass when things didn't go correctly.

To get around this, while still not having to specify the number of tests to execute, it is run a test from an END block that fails unless the test completed. This would be signified by calling a function on the last line of the test saying that everything was ok.

So something like this:

use Test::Simple 'no_plan';
use Test::Terminated;

# insert tests here

# signal we made it to the end okay
terminated_ok();

The only problem I can see with this implementation would be if something could prevent the END block from executing. I verified that it was executed upon a test exiting or dieing in the middle of execution.

Does this sound like a useful feature? Is there already support for this somewhere? If not, would it be best as a stand-alone module, or should it be incorporated into Test::Simple or Test::More... or something else?

Thanks,
 Dan

Reply via email to