Keep It Simple, Stupid | |
PerlMonks |
Re^5: Auto-compile checking??? WTF?by stevieb (Canon) |
on Apr 16, 2016 at 11:49 UTC ( [id://1160631]=note: print w/replies, xml ) | Need Help?? |
You're half way there then. Instead of using a single script that you keep changing, once you get your 'test' to run, copy it to a file with a .t extension and that's it. Of course, using Test::More is a good choice for doing the assertions. Here's the difference between a normal test script, and a real test:
test:
The latter will tell you exactly what was expected and what failed if there's a fail. The former doesn't. Not much extra effort. So if you're testing your code with one-offs, save them to test files instead, and now that part of your code will be tested every time you run your suite. Example test output from above on fail:
...because someone made a typo in the pairs() function:
In Section
Seekers of Perl Wisdom
|
|