in reply to Re^2: How do I test a script that doesn't have a .pl extension
in thread How do I test a script that doesn't have a .pl extension
That test will crash instead of failing, if foo does not exist, or is empty:
>perl -MTest::More=tests,2 -e "ok(require 'empty.pl'); print ok 1" 1..2 empty.pl did not return a true value at -e line 1. # Looks like your test exited with 255 before it could output anything +.
Q:\>perl -MTest::More=tests,2 -e "ok(require 'nonexistent.pl'); print +ok 1" 1..2 Can't locate nonexistent.pl in @INC (@INC contains: ...) at -e line 1. # Looks like your test exited with 2 before it could output anything.
You may want to let your tests just crash, because in my experience, use_ok and require_ok are just useless anyway, as no subsequent test will pass if they fail.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: How do I test a script that doesn't have a .pl extension
by ten8ciousb (Novice) on Nov 02, 2012 at 13:32 UTC |