Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: New module prototype - Test::Referenced

by SilasTheMonk (Chaplain)
on May 15, 2010 at 17:07 UTC ( [id://840151]=note: print w/replies, xml ) Need Help??


in reply to New module prototype - Test::Referenced

This reminds me of two modules: Test::Deep and Test::Regression. The former allows the module author to test complex data structures. The latter, which I have some interest in, allows a module author to compare output against previously generated output and regenerate the reference files if necessary. I think if built upon the two you would have exactly what you are trying to build.

Replies are listed 'Best First'.
Re^2: New module prototype - Test::Referenced
by Natanael (Acolyte) on May 15, 2010 at 21:27 UTC
    I must say, that I did not know Test::Regression, till now, and yes, it is in some ways similar to my idea.

    For the moment, I'm using is_deeply() from Test::More, but it could be interesting to implement a set of functions similar to ones from Test::Deep, but which would load their reference from file, instead of having it given in test. It could be an almost-drop-in replacement :-D

    Also, I like the idea behind $ENV{TEST_REGRESSION_GEN}, and I'll implement an equivalent.

    Thank You for the valuable feedback :)
      Why don't you go one further and actually use Test::Deep and Test::Regression in your implementation. I am sure both authors would appreciate any feedback generated and your module would have that much less code in it. It would make sense then to rename it Test::Deep::Regression or some variant thereof.

        At the moment, is_deeply from Test::More is all that I need to get the job done, so I intend to make a 'base' that requires just that (not counting YAML::Any).

        I agree, that I can (and probably will) use Test::Deep to support more advanced comparison methods. Yet, I see this as an optional expansion, using both: Test::Deep and mine 'base', maybe as separate (sub)package.

        I have looked into the source of Test::Regression and I can not just use it's (only?) function as-is. I would have to rewrite it to do what I intend, in the way I intend... or write another, similar sub... and add some post-exit handling to the module... I'm afraid, that after all the refactoring, not much would be left from the original module. :( Not to mention, that in my case, workflow is a bit different.
        I can't tell, whether it's actually good, or bad, as I lack the experience, but for the moment it does not 'feel' right to me.
        I hope, that when I post the working module for review/critic this will be more evident.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (6)
As of 2024-03-28 15:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found