David Fleck wrote:
An example test script starts like this:
[...]
use Test::More; BEGIN { use_ok('Statistics::Gtest') };
and, increasingly, the test fails, according to the emails I get and the
test results I see on CPAN:
/usr/bin/perl.exe "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib',
'blib/arch')" t/*.t
t/file_input..........You tried to run a test without a plan at
t/file_input.t line 6.
There's the problem, explained right there - "You tried to run a test
without a plan at t/file_input.t line 6.".
Line 6 is the 'use Test::More' line, which is copied pretty much straight
from the POD. But again, it works fine on my one local machine. What's
going on here? And how do I fix it?
(Incidentally, I do declare a plan, a few lines further down in the test
script:
plan tests => scalar (@file_objects) * 17;
Too late. You must declare your plan (or declare that you don't have a
plan) *before* trying to run any tests. (And "use_ok" is of course a
test, to test that it can "use" the module you want to load).
So, declare the plan before trying to perform /any/ tests, and it'll work.
Cheers
Dave P
--
David Precious
[EMAIL PROTECTED] :: http://blog.preshweb.co.uk/
"Programming is like sex. One mistake and you have to support
it for the rest of your life". (Michael Sinz)