Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

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 ( [id://1001974]=note: print w/replies, xml ) Need Help??


in reply to Re^3: 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

thanks. you've got a good point there. if the test can't load the script that I want to run tests against, I want it to crash and just doing
require 'foo';
will do that.
but I prefer using the ok() or require_ok() with a die or croak (which I didn't include in my example) because then in a test suite I get better diagnostic:
not ok 2 - require foo; # at /source/t/foo.t line 30. # Tried to require 'foo'. # Error: Can't locate foo.pm in @INC (@INC contains: /source/bin +... at (eval 17) line 2. Died at /source/t/foo.t line 30.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1001974]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2024-04-19 22:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found