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 }
In reply to Re: RFC: Another test module - Test::NoPlan
by shmem
in thread RFC: Another test module - Test::NoPlan
by duncs
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |