in reply to Re: Finding the parent of a text in a file ( is_deeply )
in thread Finding the parent of a text in a file

Hey 1nickt,

I recently ran into an issue while updating a module where I needed the functionality of is_deeply(), but I didn't want any test modules in the code, and I didn't want to have to hijack the output with trickery.

I came across Data::Compare, which simply returns a true/false bool if the structs match. You may be interested to play with this module for this kind of non-test work.

-stevieb

Replies are listed 'Best First'.
Re^3: Finding the parent of a text in a file ( is_deeply )
by 1nickt (Canon) on Sep 04, 2015 at 15:46 UTC

    Thanks. Looks useful. I like Test::More because it's a core module, so every installation has it, and because it indicates where the data differs (begins to differ). Usually I use this type of comparison where if it fails it should be fatal, so I don't mind the output. I can see how Data::Compare would be a better choice if you wanted to continue anyway. Interestingly, the same author has Test::Differences, which goes in the other direction (is still a Test::, spits TAP to STDOUT, provides a comprehensive diff of the structures).

    The way forward always starts with a minimal test.