Do you know where your variables are? | |
PerlMonks |
Re: How to unit test a script packaged in a module distribution?by eyepopslikeamosquito (Archbishop) |
on Apr 28, 2007 at 06:51 UTC ( [id://612512]=note: print w/replies, xml ) | Need Help?? |
Chapter 9 of the excellent book Perl Testing: A Developer's Notebook contains an interesting tactical trick to better structure scripts for testability. Their idea is to have a one-line script mainline that calls a main() function; that way you can test the script more easily from outside by hooking into the script's main() function. If you are seriously interested in Perl testing, I strongly recommend getting this book.
In Section
Seekers of Perl Wisdom
|
|