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!
In reply to Re^2: Unit testing, context and wantarray
by mikeman
in thread Unit testing, context and wantarray
by mikeman
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |