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

Re: Sharing data between tests?

by Util (Priest)
on Jan 31, 2012 at 21:31 UTC ( [id://951075]=note: print w/replies, xml ) Need Help??


in reply to Sharing data between tests?

Unless efficiency is truly critical, I would avoid Storable, along with any other binary format. Test suites (both code and data) are a form of documentation, and should be in a human-readable format.

Even when the datasets are generated during one test, and (normally) deleted later toward the end of the test suite, a human-readable (and editable) datastore will save you much frustration when diagnosing a failed test.

I have used Data::Dumper, YAML, and Config::Tiny on different projects. I think that Config::Tiny is better suited to true config files that a non-programmer will be editing. If I was saving shared test data today, JSON::XS would be my first choice.

Note that you need not just bundle the data. You can also bundle helper subroutines, that might simply return the data, or might *generate* the data in some expanded format that your tests can easily use, rather than whatever compact format the data might actually live in.

Log In?
Username:
Password:

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

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

    No recent polls found