Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Data-Compare CPAN distribution.

Report information
The Basics
Id: 34287
Status: resolved
Priority: 0/
Queue: Data-Compare

People
Owner: dcantrell [...] cpan.org
Requestors: THEPLER [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.18
Fixed in: (no value)



Subject: repeated object bug
I think this is a bug in 1.18 (the latest on CPAN right now). Attached is a patch for t/deep-objects.t. With this additional test, t/deep-objects.t will fail. It seems to me this ought to pass. I don't see how $l and $m could be considered different. I do not have a fix, though I suspect it's related to %been_there and this line: $rval = 0; # is this the right thing to do? If it's agreed that this is indeed a bug, I'd be happy to try to provide a fix. Thanks, -Todd
Subject: Data-Compare-1.18.patch
diff -ru Data-Compare-1.18/t/deep-objects.t Data-Compare-1.18.diff/t/deep-objects.t --- Data-Compare-1.18/t/deep-objects.t 2008-01-15 16:41:05.000000000 -0600 +++ Data-Compare-1.18.diff/t/deep-objects.t 2008-03-20 11:50:35.292835000 -0500 @@ -10,7 +10,7 @@ print "1..0 # Skipping no Clone found\n"; exit(0); } : - eval 'use Test::More tests => 1;'; + eval 'use Test::More tests => 2;'; use Data::Compare; @@ -26,3 +26,8 @@ Compare($j, $k); ok(Compare($j, $k), 'Can compare deeply-nested objecty jibber-jabber'); + +my $l = bless { j => $j, j_also => $j }, "Foo::K"; +my $m = bless { j => $j, j_also => $j }, "Foo::K"; +ok(Compare($l, $m), 'Can compare duplicated deeply-nested objecty jibber-jabber'); +
From: david [...] cantrell.org.uk
On Thu Mar 20 13:03:00 2008, THEPLER wrote: Show quoted text
> I think this is a bug in 1.18 (the latest on CPAN right now).
Yes, it's a bug. I'm pretty busy at the moment so it's going to take me some time to fix it, but if you can come up with a fix I can apply that quickly. There's a simpler test case that will catch it, it doesn't need to be a deeply nested object , just something as simple as this will catch it: my $z = 0; ok(Compare([\$z, \$z], [\$z, \$z]), 'Can compare duplicated data'); I've committed that test to CVS as t/duplicates.t - see http://drhyde.cvs.sourceforge.net/drhyde/perlmodules/Data-Compare/t/duplicates.t? view=markup
From: pause [...] barnyard.co.uk
I've committed what I think is the correct fix to CVS. Please test with real-world data and let me know how it goes!
Subject: Re: [rt.cpan.org #34287] repeated object bug
Date: Sat, 10 May 2008 21:09:02 -0700
To: bug-Data-Compare [...] rt.cpan.org
From: Todd Hepler <thepler [...] employees.org>
David Cantrell via RT wrote: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=34287 > > > I've committed what I think is the correct fix to CVS. Please test with > real-world data and let me know how it goes!
That works with my code, where 1.18 didn't. Thanks! -Todd