Your input (or a pointer for an earlier and better implementation of this wheel) is appreciated.
The problem with this approach (turning the exit into a die) is that it can fall down if there are other bits of exception handling code that could catch the exception thrown by exit.
Some suggestions:
The last option is probably the simplest cross-platform mechanism - something like this (untested) should do the job.
use strict; use warnings; use Test::More tests => 1; use M; f(); END { is( $?, -1, 'f() exited with -1' ) }
In reply to Re: testing exit in Perl modules
by adrianh
in thread testing exit in Perl modules
by szabgab
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |