Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Testing Non-module code

by eserte (Deacon)
on Mar 16, 2004 at 19:23 UTC ( #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.


Comment on Re: Testing Non-module code
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (9)
As of 2014-11-01 07:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (228 votes), past polls