Re: Test::More::is_deeply problems with blessings and stringified refs

2003-02-28 Thread Adrian Howard
True. I usually expose "deep" objects by methods rather than hash access, so it's not really a problem for the majority of my code. Adrian On Friday, February 28, 2003, at 03:54 pm, [EMAIL PROTECTED] wrote: On Fri, Feb 28, 2003 at 11:51:07AM +, Adrian Howard wrote: Option three. isa_ok

Re: Test::More::is_deeply problems with blessings and stringified refs

2003-02-28 Thread schwern
On Fri, Feb 28, 2003 at 11:51:07AM +, Adrian Howard wrote: > Option three. > >isa_ok($obj, 'MyClass'); >is_deeply($obj, { foo => 42, bar => 23 }); This is, unfortunately, shallow. It won't compare objects inside $obj.

Re: Test::More::is_deeply problems with blessings and stringified refs

2003-02-28 Thread Adrian Howard
On Thursday, February 27, 2003, at 09:21 pm, Fergal Daly wrote: On Thursday 27 February 2003 20:54, [EMAIL PROTECTED] wrote: On Thu, Feb 27, 2003 at 05:32:42PM +, Fergal Daly wrote: I think that although a test that ignores blessed classes could be handy in some circumstances (ie programming

Re: Test::More::is_deeply problems with blessings and stringified refs

2003-02-28 Thread Adrian Howard
I'd go for feature, not bug. For me is_deeply has always been for testing structure. We have isa_ok for checking class identity. Having one that tested for both might be useful, but I would not change the behaviour of is_deeply. Adrian On Thursday, February 27, 2003, at 05:32 pm, Fergal Daly

Re: Test::More::is_deeply problems with blessings and stringified refs

2003-02-28 Thread schwern
On Thu, Feb 27, 2003 at 10:03:50PM +, Fergal Daly wrote: > > > - 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 > > > stru

Re: Test::More::is_deeply problems with blessings and stringified refs

2003-02-28 Thread schwern
On Thu, Feb 27, 2003 at 09:21:09PM +, 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_d

Re: Test::More::is_deeply problems with blessings and stringified refs

2003-02-28 Thread schwern
On Thu, Feb 27, 2003 at 05:32:42PM +, Fergal Daly wrote: > I think that although a test that ignores blessed classes could be handy in > some circumstances (ie programming in general), I reckon in the context of > test suites it's a bug. I am already not yet convinced. In particular, it mak

Re: Test::More::is_deeply problems with blessings and stringified refs

2003-02-27 Thread Fergal Daly
On Thursday 27 February 2003 22:03, Fergal Daly wrote: > Would it be acceptable to add a third argument to _deep_check to switch > on/off bless checking, rather than having to reimplement the whole thing? Below is a very simple patch to do that. That makes cmp_object very easy F -- Do you need

Re: Test::More::is_deeply problems with blessings and stringified refs

2003-02-27 Thread Fergal Daly
On Thursday 27 February 2003 21:35, [EMAIL PROTECTED] wrote: > On Thu, Feb 27, 2003 at 09:21:09PM +, Fergal Daly wrote: > > Or even better, cmp_objects(). Yep, sounds better. > > - let _deep_check take it's cue from the second argument. If the second > > argument is blessed then be strict ab

Re: Test::More::is_deeply problems with blessings and stringified refs

2003-02-27 Thread Fergal Daly
On Thursday 27 February 2003 20:54, [EMAIL PROTECTED] wrote: > On Thu, Feb 27, 2003 at 05:32:42PM +, Fergal Daly wrote: > > I think that although a test that ignores blessed classes could be handy > > in some circumstances (ie programming in general), I reckon in the > > context of test suites

Test::More::is_deeply problems with blessings and stringified refs

2003-02-27 Thread Fergal Daly
On Thursday 27 February 2003 16:40, [EMAIL PROTECTED] wrote: > > is_deeply() ignores the classes of blessed refs. So > > > > perl -MTest::More=no_plan -e 'is_deeply(bless([], "a"), bless([], "b"))' > > > > passes, > > Oh. Not sure if that's a bug or a feature. Discuss it on perl-qa. I think that