develooper Front page | perl.qa | Postings from February 2007

Re: Bad test functions in Test::Exception

Thread Previous | Thread Next
From:
Joshua ben Jore
Date:
February 1, 2007 13:37
Subject:
Re: Bad test functions in Test::Exception
Message ID:
dc5c751d0702011337x4a6290fej7b2cefcb664d5ac0@mail.gmail.com
On 2/1/07, Adrian Howard <adrianh@quietstars.com> wrote:
> On 1 Feb 2007, at 16:28, Joshua ben Jore wrote:
> [snip]
> > There's is nothing special about what T::E is doing to detect errors -
> > it just turns out the popular practice of looking at $@ is flawed.
> > That's a problem with the pattern and I expect that what it means is
> > that if T::E starts detecting errors that were previously being
> > ignored that the user really ought to be fixing up their code because
> > that's buggy as well.
>
> I don't like labelling the change in behaviour an error. Sometimes it
> might be. Sometimes it might not. I'd like T::E to support both
> options. Especially since the errors can be in third party code that
> doesn't affect the behaviour of the code under test.

Ok, I'll give you that a user may want to ignore errors that occur
during scope cleanup but from the point of view of T::E, it seems
relatively clear that an error really has occurred. I'd tend to think
that T::E's default behavior would be to be as careful as possible and
only less so if the user asks for it. I think it'd be great if a
user's tests break because T::E changed. That'd mean there's something
they were probably overlooking. They're forced to react to it. That's
good, isn't it? Just because modules use T::E without error *today*
doesn't mean they should pass tomorrow if and when bugs in T::E are
discovered.

I'd be a happy guy if a paranoid T::E caused consternation and people
to post "OMG! My stuff fails now!" to perlmonks or whatever.

Josh

Thread Previous | Thread Next


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