in reply to Re: Unit testing, context and wantarray
in thread Unit testing, context and wantarray
Thanks for your reply.
I think you answer has pointed me in the right direction: I am trying to test for the wrong thing. I should be testing (perhaps via a mock object or similar), that my function does not do anything expensive (e.g., call a database function) to return a result when called in void context. I was erroneously focusing on the return result, rather than the operations of my function. Testing the return value (or lack thereof) would not prove if my function was performing a pointless operation.
Thanks!
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Unit testing, context and wantarray
by GrandFather (Saint) on Aug 13, 2011 at 11:33 UTC | |
Re^3: Unit testing, context and wantarray
by eyepopslikeamosquito (Archbishop) on Aug 13, 2011 at 11:43 UTC | |
by FunkyMonk (Chancellor) on Aug 13, 2011 at 14:15 UTC |