Re: Munging output when running warning tests

2008-05-04 Thread Aristotle Pagaltzis
* Jonathan Rockway <[EMAIL PROTECTED]> [2008-05-03 21:15]: > You said you're trying to emulate $@, but $@ can be changed out > from under you rather easily, so instead of: > > eval { foo() }; > if($@){ error } > > The defensive programmer will write: > > my $result = eval { foo() }; > if

Re: Munging output when running warning tests

2008-05-04 Thread Eirik Berg Hanssen
Jonathan Rockway <[EMAIL PROTECTED]> writes: > I think the most sane interface would be: > > my $trap = trap { ... }; > is $trap->foo, 'foo'; > is $trap->bar, 'bar'; Test::Trap already provides: trap { ... }; is $trap->foo, 'foo'; # for certain values of foo is $trap->bar, 'bar'; # ... a