Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://337093]
help
Chatterbox?
[Discipulus]: yees.. masonry, shaving of the ceiling (dunno if shaving is the right term..) 20hours in the weekend.. so veery good ;=)
[LanX]: yes I worked ...
[LanX]: ... and hope to get a free work day in compensation. :)
choroba went to a museum with the older children. The exhibition was called "American Indians".
[Discipulus]: this and...
[Discipulus]: shaving the ceil

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (9)
As of 2018-02-19 10:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When it is dark outside I am happiest to see ...














    Results (261 votes). Check out past polls.

    Notices?