Any use statement (no statement, BEGIN block, END block, etc.) will always get executed no matter how the enclosing module is used.
That is true, so I don't do that. I don't use the Test::* modules as they tell me what passed rather than what failed. I also have very definite ideas about the form that unit testing should take and that does not fit well with the pattern of a zillion ok()/not_ok() tests that those modules encourage.
If my test code needs additional modules, I require them not use them. On the rare occasions I've felt the need for BEGIN/INIT/CHECK/END blocks, they've been an inherent part of the module not the testcode.
In reply to Re^3: Self-testing modules
by BrowserUk
in thread Self-testing modules
by DrWhy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |