This approach has a problem -- you won't be testing production code with this flag set e.g.:
If code needs to know that it is being tested, I suspect something wrong with the interface. Also, may be you should have a look onto mocking modules like Test::MockObject.if ($self->_test_mode) { # test_code } else { # production code, not tested }
In reply to Re: Universal test flag
by zwon
in thread Universal test flag
by ait
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |