[Pdx-pm] is_deeply and objects

Josh Heumann perl-pm at joshheumann.com
Fri Feb 25 15:48:56 PST 2005


<quote who="Michael G Schwern">
> Also, what about this?
>
>   package Foo;
>   sub new { return bless { foo => 42 } }
>
>   package Bar;
>   @ISA = qw(Foo);
>
>   package main;
>   use Test::More tests => 1;
>
>   my $foo = Foo->new;
>   my $bar = Bar->new;
>
>   is_deeply( $foo, $bar );
>
> If is_deeply were object-aware should that pass or fail?  Maybe, maybe
> not.

Advocating devilishly, what are the arguments for it failing?  If there
are two objects, blessed with the same class and containing the same data,
are they really different?

>> This question is posed in honor of Schwern's arrival.  Schwern: who
>> loves ya, baby?
>
> According to my spam folder, Jeanna11111 is hot and waiting for me right
> now.

Lucky you.  And the other 42,000 people.

Josh




More information about the Pdx-pm-list mailing list