in reply to Test::More usage to test functions that die
One way is to overload croak() inside your test, then make sure that calling your function calls croak() under the right circumstances. E.g.:
# (pseudocode) our $croakcount; sub main::croak { $croakcount++; } myfunc(my $badoptions); is ($croakcount, 1, "myfunc() calls croak()");
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Test::More usage to test functions that die
by stvn (Monsignor) on Dec 08, 2004 at 15:21 UTC | |
by trammell (Priest) on Dec 08, 2004 at 16:22 UTC |
In Section
Seekers of Perl Wisdom