On Wed, Jun 30, 2004 at 09:59:15AM -0400, Geoffrey Young wrote:
> I found some stuff about is_deeply() and stringified references, but it
> doesn't look to me to be the same thing. the problem I am describing is the
> difference specifically between an empty string and undef.
>
> is_deeply([''],[undef]);
>
> improperly says that the two arrays are equal.
>
> is_deeply(['foo'],[undef]);
>
> behaves as expected.
>
> am I missing something is the discussion?
Actually, it seems that some of the patches were applied. The problem is
that is_deeply() delegates to ->is_eq() for non deep arguments but handles
it's own string comparison once you descend into the structure. The patch
below seems to fix it,
F
--- More.pm.orig 2004-06-30 15:15:24.182762112 +0100
+++ More.pm 2004-06-30 15:16:36.330793944 +0100
@@ -1035,7 +1035,9 @@
# Quiet uninitialized value warnings when comparing undefs.
local $^W = 0;
- if( ! (ref $e1 xor ref $e2) and $e1 eq $e2 ) {
+ if( ! (ref $e1 xor ref $e2) and
+ ! (defined $e1 xor defined $2) and
+ $e1 eq $e2 ) {
$ok = 1;
}
else {