Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Testing Non-module code

by eserte (Deacon)
on Mar 16, 2004 at 19:23 UTC ( [id://337093]=note: print w/replies, xml ) Need Help??


in reply to Testing Non-module code

With "ol' procedural code" do you mean collections of functions in .pl files or standalone scripts? If you mean the first, then you can do normal Test::* tests, just require the file instead use'ing it. In the second case you may consider to convert the script into a hybrid script/module --- this is not too hard, just move the running part below a return 1 if caller; line. Now you can require the file and test the subroutines in it without running the script. If you don't have subroutines at all, then you can still check for side effects (e.g. created or changed files, or screen output). If the script is interactive, then you could consider to use Expect.pm.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2024-04-18 02:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found