[Rt-devel] Possible RT testing bug

Todd Chapman todd at chaka.net
Thu Mar 10 08:05:30 EST 2005


On Thu, Mar 10, 2005 at 01:18:13PM +1030, Matthew Draper wrote:
> Todd Chapman wrote:
> 
> > Matthew Draper wrote:
> > 
> >>Todd Chapman wrote:
> >>
> >>>RT::Ticket::Create returns an array, so when evaluated in
> >>>a scalar context it is always true. Correct?
> >>>
> >>>If so, isn't this testing code from Tickets_Overlay_SQL flawed?
> >>>
> >>>ok( $t->Create(Queue => 'General', Subject => $string), "Ticket Created");
> >>
> >>Flawed in so much as it doesn't do what it looks like it does,
> >>certainly. It does actually do the right test, though. :)
> >>
> >>Look closer... that looks suspiciously like a list context to me.
> >>
> > 
> > I don't think so. ok() compares to scalars.
> 
> Yes, but before it does so, Perl evaluates the list of arguments to pass
> it.
> 
> (Sorry about hitting the wrong reply button before.)

I don't get it. Are you saying that there is no bug in the code above?
There is a bug, because the test will always pass, even if Queue is
mis-spelled.


More information about the Rt-devel mailing list