Re: Return values from a test as a right value.

2007-02-26 Thread Eric Hacker
On 2/26/07, Michael G Schwern <[EMAIL PROTECTED]> wrote: Also you don't want it to always be true. You want it to reflect whether the test passed or failed. I presume you still want the extra value even if the test failed. Well, at first I didn't think that I'd want it, but after seeing your

Re: Return values from a test as a right value.

2007-02-26 Thread A. Pagaltzis
* Michael G Schwern <[EMAIL PROTECTED]> [2007-02-25 00:00]: > You can return a little wrapper > object like... > > # I didn't actually try this > package Test::Result; Or use Scalar::Util::dualvar (Perl uses the string value to check truth so the numeric value may be whatever). Regar

Re: Return values from a test as a right value.

2007-02-26 Thread Michael G Schwern
Mark Fowler wrote: > > On 24 Feb 2007, at 22:58, Michael G Schwern wrote: > >> Just make sure whatever you return evaluates according to the test >> pass/fail >> and not its value and you should be fine. You can return a little >> wrapper >> object like... > > Or you could just return a referen

Re: Return values from a test as a right value.

2007-02-26 Thread Mark Fowler
On 24 Feb 2007, at 22:58, Michael G Schwern wrote: Just make sure whatever you return evaluates according to the test pass/fail and not its value and you should be fine. You can return a little wrapper object like... Or you could just return a reference to an array with the value in it

Re: Return values from a test as a right value.

2007-02-24 Thread Michael G Schwern
chromatic wrote: > On Saturday 24 February 2007 06:47, Eric Hacker wrote: > >> Is it OK to have the return value from a test be something more than >> just true when a test passes? Thus the test might be used as a right >> value in the test script. > > Seems like, in general, the semi-predicate p

Re: Return values from a test as a right value.

2007-02-24 Thread chromatic
On Saturday 24 February 2007 06:47, Eric Hacker wrote: > Is it OK to have the return value from a test be something more than > just true when a test passes? Thus the test might be used as a right > value in the test script. Seems like, in general, the semi-predicate problem. What if the value b

Return values from a test as a right value.

2007-02-24 Thread Eric Hacker
Hello Perl QA Wizards, I apologize in advance if this is documented somewhere, because I must have missed it. Is it OK to have the return value from a test be something more than just true when a test passes? Thus the test might be used as a right value in the test script. Background: I am work