Eric Wilhelm wrote:
At the bottom of a test file:
{my $finish = 1; END {$finish or die "\n unplanned exit"}};
Yeah, you have to remember to put it at the end of the file, but it may
be easier than counting tests. Thoughts? Maybe an 'until_done'
directive and 'tests_done' function? Ways to check that there is no
code after tests_done()?
*sigh* Nobody ever looks at the ticket tracker.
http://rt.cpan.org/Public/Bug/Display.html?id=20959
Sun Nov 05 13:07:03 2006 MSCHWERN - Correspondence added
I think I like this. I'm just always hesitant to add more functions to
Test::More so I need some convincing on the name.
Yes, this sort of thing is a good idea and there's already a patch for it.
The only real issue is the naming of the plan type and the "I'm done"
function. Discuss.
Additionally, the patch supplied a "plan_at_end" where you can supply a
fixed number but don't have to do it before you run any tests. This is
handy for those tricky situations where the number of tests run is
non-deterministic.
Finally, I wouldn't mind an easy way to say "I'm going to run two more
tests" to the "plan_at_end" variant.