When unit testing, how do I test that a function returns nothing when called in void context?
For example, I can easily test if the following function returns a list or a scalar containing 'value'. But as soon as I test its return value, I am no longer calling the function in void context.
sub context { return unless defined wantarray; return wantarray ? ('value') : 'value'; }
Thanks, and sorry if this is a dumb question!
In reply to Unit testing, context and wantarray by mikeman
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |