I'm beaten over this argument. After a little thought,
I agree with Andy and chromatic that the "plan at the end"
buys very little and can disturb the simplicity of the testing
API for nothing.

After all, it is very easy to write a code like that
and rewrite our examples.


   use Test::More 'no_plan';


   =head2 B<plan_ok>

       plan_ok tests => $expected_number_of_tests;

   Tests whether the number of tests so far matches
   the argument.

   =cut

   sub plan_ok {
       require Test::Builder;
       my $tester = Test::Builder->new(); # or Test::More->builder();
would be better?

       my $opt = shift; # must be 'tests'
       my $tests = shift || 0;
       my $desc = shift || "$tests tests run so far";
       $tester->is_num($tests, $tester->current_test, $desc);
   }

   my $count = 0;
   for (@ARGV) {
       ok("\$ARGV[$count] is just fine\n");
       $count++;
   }

   plan_ok tests => $count;



I think this is just the functionality me and Gabor were
looking for, but without a need to change a bit of
Test::More. The only thing to guarantee is that the
implementation of C<plan_ok> is stable enough - but
(modulo argument checking)
it seems the case, since C<Test::Builder->current_test>
is part of the public API.

Of course, the other part that concerns Gabor - having
the harness check the plan at the end to make sure
the test script spitted a plan - is worthy to consider
and is not addressed here.

Regards,
Adriano Ferreira

Reply via email to