Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^2: Does Data::Dumper give you eye strain? Use Test::More::is_deeply() for debugging!

by ChemBoy (Priest)
on Jul 20, 2005 at 20:37 UTC ( #476612=note: print w/replies, xml ) Need Help??


in reply to Re: Does Data::Dumper give you eye strain? Use Test::More::is_deeply() for debugging!
in thread Does Data::Dumper give you eye strain? Use Test::More::is_deeply() for debugging!

I'm not sure I quite agree that is_deeply doesn't do a deep comparison at all, though I agree that it has a quirk or two. But more to the point, what does Test::Struct offer that Test::Deep doesn't? Not meant rhetorically, I'm just curious, since they both seem to have the same basic goal.



If God had meant us to fly, he would *never* have given us the railroads.
    --Michael Flanders

  • Comment on Re^2: Does Data::Dumper give you eye strain? Use Test::More::is_deeply() for debugging!

Replies are listed 'Best First'.
Re^3: Does Data::Dumper give you eye strain? Use Test::More::is_deeply() for debugging!
by demerphq (Chancellor) on Jul 20, 2005 at 23:59 UTC

    I think I should leave that up to Fergal to answer, however its my understanding that what T::S does is different from what T::D does (I know for sure that the latter is considerably more flexible and attempts to solve problems that T::S doesnt and never will).

    Test::Struct was simply my attempt at making an is_deeply() that worked the way I expect it to. To save you reference to some very long and nasty perl-qa threads I'll simply say that as the author of the most accurate Perl Data serialization module currently on CPAN I found every other tool for testing insufficient for my purposes. Test::Struct is/was a prototype I wrote for the kind of testing I wished had been around for Data::Dump::Streamer. Some argue that this level of accuracy is only really useful for testing serialization modules but whatever. Anyway i wrote T::S just before i went on holiday (which im still on) so its in an alpha state right now, somethiong i plan to resolve when i return.

    ---
    $world=~s/war/peace/g

Re^3: Does Data::Dumper give you eye strain? Use Test::More::is_deeply() for debugging!
by fergal (Chaplain) on Jul 21, 2005 at 00:12 UTC
    TS is the strictest possible comparison that doesn't involve comparing reference addresses, so if $x=[];$y=[] then TS will say that [$x,$x] is not the same as [$x,$y] because one is an array with 2 refs to 1 array and the other has refs to 2 different arrays. This is a valid difference. TD ignores this difference. TD also lets you do something a little bit like regular expressions for data structures.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2019-08-21 04:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?