On Thu, May 10, 2001 at 07:31:18PM +0100, Michael G Schwern wrote:
: I'm running into alot of problems with this:
:
: use Test::Simple tests => 42;
:
: The problem is, Test::Simple expects you to specify the number of
: tests when you load it and thus *at your script's compile time*. It
: also means that the '1..N' line is printed at compile time. This has
: the awful side-effect of "perl -cw test.pl" printing out the 1..N.
:
: I also have to do some very careful hacks when testing Test::Simple to
: make sure I don't accidentally trip this behavior. Test::More, and
: other wrappers around Test::Simple, must also be very careful around
: it. "use Test::Simple" without a plan is currently an error.
:
: The original intention was to make it very obvious that you have to
: declare your tests and to make them occur at compile time (before you
: load any modules). I think its just too much trouble (and not nearly
: simple enough) and I'm considering splitting this off into a seperate
: function a la Test.pm's plan().
:
: use Test::Simple;
: plan tests => 42;
:
: while leaving the current interface in place.
Sounds like a good plan. You could set a flag in Test::Simple that
forces you to plan() before you do any test()ing. That would still
force the programmer to plan() first.
I like it.
Casey West
--
Guide to understanding a net.addict's day:
Slow day: didn't have much to do, so spent three hours on usenet.
Busy day: managed to work in three hours of usenet.
Bad day: barely squeezed in three hours of usenet.