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

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

From:
Paul Marquess
Date:
August 28, 2001 07:03
Subject:
RE: [PATCH pod/perlhack.pod t/op/pack.t] Fixing bad testing advice
Message ID:
AIEAJICLCBDNAAOLLOKLGEMOCNAA.Paul_Marquess@Yahoo.co.uk
From: Michael G Schwern [mailto:schwern@pobox.com]

> 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?

Paul


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About