Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Test-Simple CPAN distribution.

Report information
The Basics
Id: 663
Status: resolved
Priority: 0/
Queue: Test-Simple

People
Owner: Nobody in particular
Requestors: dmcgarry [...] e-smith.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.42
Fixed in: (no value)



Subject: ok(defined $foo) broked?
I've got a very weird circumstance happening in my unit tests =begin testing my $test_result = $object->method_that_returns_undef(); ok(defined $test_result, "This shouldn't pass, but it does!"); =end testing =cut sub method_that_returns_undef { return undef; } Why does this happen, and how do I make it stop? 8^) Seriously, though - I suspect it's a bug. I came across it while I was trying to determine whether a hashref was getting populated or not.
Date: Fri, 24 May 2002 20:04:53 -0400
From: schwern [...] pobox.com
To: Guest via RT <bug-Test-Simple [...] rt.cpan.org>
Subject: Re: [cpan #663] ok(defined $foo) broked?
On Fri, May 24, 2002 at 03:27:38PM -0400, Guest via RT wrote: Show quoted text
> Why does this happen, and how do I make it stop? 8^)
Are you really, really, really, really sure that it is in fact undef? Have you tried instead: is( $var, undef ); -- Michael G Schwern <schwern@pobox.com> http://www.pobox.com/~schwern/ Perl Quality Assurance <perl-qa@perl.org> Kwalitee Is Job One
[schwern@pobox.com - Fri May 24 20:05:00 2002]: Show quoted text
> On Fri, May 24, 2002 at 03:27:38PM -0400, Guest via RT wrote:
> > Why does this happen, and how do I make it stop? 8^)
> > Are you really, really, really, really sure that it is in fact undef?
More than that, I'm certain. Really. 8^) Show quoted text
> Have you tried instead: > > is( $var, undef );
Yes, I used is() to verify that the value was indeed undef.