NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
done_testing( $arg )? (Score:1)
I like to use the argument done_testing accepts that lets you say how many tests you expected to have run at that stage.
Its like specifying a plan, except you can do so pro grammatically after the fact, which eliminates the need for tedious manual counting.
All you need to know is how many tests occur within a given block of code and increment your counter respectively.
use Test::More;
my $t;
$t+=2;
foreach ( list() ) {
ok( $_, 'List member ok' );
}
$t+=3; # list called the second time
Re:done_testing( $arg )? (Score:2)
There's surely a better way to get the same effect.
Switch to Test::Class. I've an [cpan.org]extensive article on its use and best practices [slideshare.net]. When nested TAP is finally stable, Adrian Howard has a new version available which utilizes it. It's much cleaner.
Reply to This
Parent
Re: (Score:2)
I've found that that Test::Class testing code is significantly harder to maintain that the "bunch of Perl scripts" of the regular way.
That's just me though...