Another way :-)
If you don't mind running an indeterminate number of tests, just use Test::Exception's lives_ok. For example:
use Test::More 'no_plan'; use Test::Exception; lives_ok { my $x= new blahblah; $x->foo (5000); $x->bar(200); my $ot= output_test->new ("out1"); my $outfile= $ot->openout(); $x->emit ($outfile); $ot->ok_files_match(); } 'test case out1 worked'; # ... etc ...
In reply to Re: Writing code using Test::More -- how to fail within subs?
by adrianh
in thread Writing code using Test::More -- how to fail within subs?
by John M. Dlugosz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |