[Kc] Test::More Inline

djgoku djgoku at gmail.com
Fri Mar 18 13:56:47 PDT 2011


So I am in the process of writing a perl script and I don't really
want to have multiple files, one for the actually script and another
for testing. So I have written all my tests in the same file using
Test::More. The perl script uses a command line switch (-t) to enable
running tests then exits Has anyone ever done this before? Is there a
better way less using multiple files?

if($test) {
   # run tests and exit
} else {
   main();
}

Jonathan


More information about the kc mailing list