in reply to Re^5: Does anybody write tests first?
in thread Does anybody write tests first?
Sorry, but you'll have to explain to me how testing that perl can load a module detected a bug...
Module loading in Perl 5 is not transactional. If there's a compilation error halfway through the code and the rest of the module fails to compile, all of the symbols defined in the first half and all of the side effects executed as a result of compiling the first half are still in effect.
The best way I've found to detect that is to use the return value of use_ok:
use_ok( 'Some::Module' ) or exit;If the module fails to load completely, the test file will stop execution right there.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^7: Does anybody write tests first?
by BrowserUk (Patriarch) on Feb 22, 2008 at 21:00 UTC | |
by chromatic (Archbishop) on Feb 22, 2008 at 21:28 UTC |
In Section
Seekers of Perl Wisdom