On Sat, Nov 24, 2001 at 02:56:54PM -0700, chromatic wrote:
> > Crap, this doesn't quite work in the general case.
> >
> >     is( undef, undef );     # ok
> >     is( 0,     undef );     # not ok
> >     is('',     undef );     # ok
> >
> > is() uses eq and undef stringifies to ''.  is( $foo, undef ) is a nice
> > idiom, though.
> 
> I got it from *somewhere*.  I'd almost swear it was in the first version of 
> Test::Builder, having been untimely ripped from the womb of pre-wrapper 
> Test::More.

I was using it without realizing it subtly didn't work.


> > Should is() distinguish between undef, 0 and ''?  Seeing as how it
> > already does between undef and 0 (accidentally), I guess it wouldn't
> > hurt.
> 
> Perl does, why shouldn't the tests?

Ok, just uploaded Test::Simple 0.34 to CPAN which makes undef a beast
different from 0 or ''.  Let's see how it goes over.
http://www.pobox.com/~schwern/src/Test-Simple-0.34.tar.gz

-- 

Michael G. Schwern   <[EMAIL PROTECTED]>    http://www.pobox.com/~schwern/
Perl Quality Assurance      <[EMAIL PROTECTED]>         Kwalitee Is Job One
local $variable for local @people;

Reply via email to