On Thu, Feb 27, 2003 at 09:21:09PM +0000, Fergal Daly wrote:
> > I am already not yet convinced.  In particular, it makes this sort of test
> > more difficult than it needs be:
> >
> >     is_deeply($obj, { foo => 42, bar => 23 });
> 
> Absolutely, but there is currently no way to do this
> 
> is_deeply($obj, bless({ foo => 42, bar => 23 }, "MyClass"));
> 
> and get a fail if $obj is not in MyClass - as I found out today ;-(
> 
> 2 solutions spring to mind
> 
> - create is_deeply_blessed

Or even better, cmp_objects().


> - let _deep_check take it's cue from the second argument. If the second 
> argument  is blessed then be strict about the classes, if it's unblessed then 
> ignore the classes. This should happen at all levels in the structures.

This sounds too magical.

Either way, Test::More's is_deeply() behavior isn't likely to change, so
Test::Set will have to take care of it.

Reply via email to