in reply to testing a croak
You can use the Test::Exception module and test with either dies_ok(tests for death) or throws_ok (tests for death with a specific error message).
use Test::Exception => 1; throws_ok { dying_sub() } qr/I always die/, "sub dies with correct err +or message";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: testing a croak
by arcnon (Monk) on Jan 19, 2006 at 13:44 UTC | |
by tirwhan (Abbot) on Jan 19, 2006 at 14:38 UTC | |
by Anonymous Monk on Jan 19, 2006 at 14:39 UTC | |
by tirwhan (Abbot) on Jan 19, 2006 at 14:57 UTC | |
by arcnon (Monk) on Jan 19, 2006 at 16:35 UTC |