in reply to RFC: Another test module - Test::NoPlan
An easy way to keep your number of tests up to date is using BEGIN blocks:
use Test::More; use vars qw($n_tests); use_ok 'Foo::bar'; BEGIN { $n_tests++ } my $c = 10; for (1..$c) { ok Foo::new->($_); } # BEGIN { $n_tests += $c } # oops, wrong. my $c not visible here BEGIN { $n_tests += 10 } # ... and so on # at last: BEGIN { plan tests => $n_tests }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: RFC: Another test module - Test::NoPlan
by tilly (Archbishop) on May 21, 2009 at 05:16 UTC | |
by shmem (Chancellor) on May 21, 2009 at 15:29 UTC | |
|
Re^2: RFC: Another test module - Test::NoPlan
by DStaal (Chaplain) on May 20, 2009 at 19:06 UTC |