in reply to Test::Exception extension with (evil?) overloading
So, you want to wrap the sub-ref argument so that it can orthogonally apply to all the tests.
Another way to have a modifier that applies orthogonally to all tests would be to pass the underlying test as well:
This would evaluate subref in an eval, failing if it dies. Then, take the result and pass it, along with the remaining @args, to the innertest function, whose result is returned.wrapper (\&innertest, \&subref, @args)
So you could pass anything you want as the inner test.
—Johnwrapper (\&is, {$o->answer}, 42, 'answer returned 42');
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Test::Exception extension with (evil?) overloading
by adrianh (Chancellor) on Jan 18, 2003 at 18:51 UTC | |
by Aristotle (Chancellor) on Jan 18, 2003 at 20:40 UTC | |
by adrianh (Chancellor) on Jan 18, 2003 at 21:50 UTC | |
by Aristotle (Chancellor) on Jan 18, 2003 at 22:11 UTC | |
by adrianh (Chancellor) on Jan 18, 2003 at 23:15 UTC |