[Rt-devel] Possible RT testing bug

Matthew Draper matthew at trebex.net
Wed Mar 9 21:48:13 EST 2005


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.)

-- 
matthew at trebex.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
Url : http://lists.bestpractical.com/pipermail/rt-devel/attachments/20050310/e1cb1184/signature.pgp


More information about the Rt-devel mailing list