Update: What I didn't specify, but perhaps should have, is that parts of the data structure are blessed object references, and I want to compare the guts of the objects.

Conclusion:

ModuleConclusion
Data::DumperHashes not consistently serialised
Test::MoreOnly does a shallow comparison.
Tie::IxHashSolves a different problem. Anonymous hashes cannot be tied
FreezeThawOnly copes with shallow structures
Struct::CompareDoes not handle references
Recursive comparison by thraxilDoes not handle object references
Data::CompareDoes not handle references

Conclusion: either fix Data::Dumper or roll my own compare routine :-<.

Update 2: I have been looking further at Test::More. There are numerous versions floating about, owing to the way in which people have used it to package up their tests in their own modules.

The definitive Test::More on CPAN has a function eq_hash, which suffers from the same syndrome as Data::Dumper when it comes to ordering of keys.

Update 3: simonm++ The module Class::MakeMethods::Utility::Ref does the business! Shame about the name - something as useful should not IMO have a module name 4 levels down, with no clue as to what it can do.


In reply to Re: Need a test for deep equality by rinceWind
in thread Need a test for deep equality by rinceWind

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.