develooper Front page | perl.perl5.porters | Postings from August 2001

RE: [PATCH pod/perlhack.pod t/op/pack.t] Fixing bad testing advice

Paul Marquess
August 28, 2001 07:03
RE: [PATCH pod/perlhack.pod t/op/pack.t] Fixing bad testing advice
Message ID:
From: Michael G Schwern []

> On Tue, Aug 28, 2001 at 02:30:19PM +0100, Paul Marquess wrote:
> > In my modules I use an ok sub, but I tell it the test number
> >
> >     ok 23, $sometest eq $something ;
> >
> > I use a script to automatically renumber them when I add or
> delete tests.
> I'm continually amazed at the elaborate solutions people come up with
> for the simplest testing problems.

For core tests, I agree that a unified approach is a sensible idea. For
external modules where the user may still be running 5.004, you have to roll
your own solution.

> Sorry, this isn't directed at anyone in particular, I've just seen so
> many people layed low by the simple problem of dealing with test
> numbering.

No problem :-)

I forgot to mention in my reply, but does this statement from t/TEST not
also apply to the lower level tests in the harness?

  # This is written in a peculiar style, since we're trying to avoid
  # most of the constructs we'll be testing for.

Does an ok sub make use of too many features in some of the tests?


Do You Yahoo!?
Get your free address at Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About