On 30 Jan 2007, at 19:48, Eric Wilhelm wrote:
# from Nadim Khemir
# on Tuesday 30 January 2007 09:17 am:
# all Test::Exceptions subroutines are guaranteed to preserve the
state # of $@ so you can do things like this after throws_ok and
dies_ok like $@, 'what the stringified exception should look like';
This wouldn't be needed if dies_ok didn't exist.
I think the arguments in favor of dies_ok are good. But, I think it
would be better to return the $@ rather than trying to preserve it.
[snip]
This breaks the convention that Test::More of test methods returning
the test failure status so you can have things like:
lives_ok { $o->fribble } or diag "Hmmm... unexpected failure",
Dumper( $o );
I quite like this, and it's too late to change anyway :-)
Cheers,
Adrian