On Thu, Jul 31, 2003 at 10:29:52AM +0100, Tony Bowden wrote: > >From Test::More docs: > > # XXX BAD! $pope->isa('Catholic') eq 1 > is( $pope->isa('Catholic'), 1, 'Is the Pope Catholic?' ); > > This does not check if "$pope-"isa('Catholic')> is > true, it checks if it returns 1. Very different. > Similar caveats exist for false and 0. In these > cases, use ok(). > > ok( $pope->isa('Catholic') ), 'Is the Pope Catholic?' ); > > This was presumably a better example before the isa_ok function was added ... > Perhaps this should be changed to something similar that couldn't use that?
How about this... You are encouraged to use is() and isnt() over ok() where possible, however do not be tempted to use them to find out if something is true or false! # XXX BAD! is( exists $brooklyn{tree}, 1, 'A tree grows in Brooklyn' ); This does not check if C<exists $brooklyn{tree}> is true, it checks if it returns 1. Very different. Similar caveats exist for false and 0. In these cases, use ok(). ok( exists $brooklyn{tree}, 'A tree grows in Brooklyn' ); -- Michael G Schwern [EMAIL PROTECTED] http://www.pobox.com/~schwern/ I stare into the Abyss, and it avoids making eye contact.