No such thing as a small change | |
PerlMonks |
Re^3: Debugging a module that's failing under taint modeby kcott (Archbishop) |
on Jul 01, 2021 at 23:37 UTC ( [id://11134575]=note: print w/replies, xml ) | Need Help?? |
I write tests for every single module I create. That includes personal and $work modules. And the first one is always 00-load.t. Writing tests is extremely important — I can't stress this strongly enough. Run 'make test' every time you change Module.pm; that provides a regression test. Now write one or more new tests that address whatever changes you made. If you're only changing a test, or want more specific feedback from a test, use 'prove -vb t/whatever.t'. It might seem like extra work but, in the long run, it will save you much time and frustration. If you use something like Module::Starter, some tests will be automatically written for you; you can write generic test templates which you copy to 't/' and then just do a global substitution, e.g. s/___MODULE_NAME___/Module::Name/g; you can write boilerplate tests which you can just copy and leave as is (see 't/99-02_manifest.t' in "Re: Perl tools for making code better" for an example — that's the first block of code; the filename is mentioned further down). I absolutely concur with ++stevieb's "famous last words" comment. — Ken
In Section
Seekers of Perl Wisdom
|
|