Re: maint @ 21116

2003-09-09 Thread Fergal Daly
On Tuesday 09 September 2003 18:40, Tony Bowden wrote: > > It's incredibly useful for testing the innards of objects, I think that's what > > people use it for. > > I still don't think it should be. An object is not a hashref or a > listref. It might happen to be implemented by blessing a hashre

Re: Test::More and 'deep' tests

2003-09-09 Thread Fergal Daly
On Tuesday 09 September 2003 19:23, Tels wrote: > I agree. For instance, ok() just looks at the outside, and if it compares ok, > the objects are considered equal. After all, this is the entire point behind > overloading and tie, to "fake" something. For instance, this "feature" of > ok() makes

RE: Test::More and 'deep' tests

2003-09-09 Thread Gordon Henriksen
Fergal Daly <[EMAIL PROTECTED]> wrote: > On Tuesday 09 September 2003 19:27, Gordon Henriksen wrote: > > > Isn't the easiest way to get a recursive-and-exact object graph > > match to simply use an existing serializer (FreezeThaw, > > Data::Dumper)? > > If you want a yes/no answer then it probab

Re: maint @ 21116

2003-09-09 Thread Tony Bowden
On Tue, Sep 09, 2003 at 06:09:16PM +0100, Fergal Daly wrote: > But it doesn't fail, it never has failed and it was never intended to fail. > is_deeply is specifically for looking at and descending into the structure of > it's arguments, otherwise what's the point? Where's the "deep"ness? I don't

Re: Test::More and 'deep' tests

2003-09-09 Thread chromatic
On Tuesday, September 9, 2003, at 11:23 AM, Tels wrote: From my point of view is_deeply() is an extended ok(), which also walks arrays, hashes and other (possible nested) structures, and then compares _each_ element. This is how I've always seen it, assuming Tels meant is() instead of ok() above

Re: Test::More and 'deep' tests

2003-09-09 Thread Fergal Daly
On Tuesday 09 September 2003 19:27, Gordon Henriksen wrote: > Isn't the easiest way to get a recursive-and-exact object graph match to > simply use an existing serializer (FreezeThaw, Data::Dumper). This > leverages the circular reference handling and introspection smarts built > into those librari

Re: Test::More and 'deep' tests

2003-09-09 Thread Andrew Wilson
On Tue, Sep 09, 2003 at 05:49:47PM +0100, Fergal Daly wrote: > On Tuesday 09 September 2003 15:29, Tony Bowden wrote: > > my $str1 = MyString->new("foo", "bar"); > > my $str2 = MyOtherString->new("foo", "baz"); > > Now they _do_ differ by more than just class and it should be a fail, although > I

Re: Test::More and 'deep' tests

2003-09-09 Thread Tels
-BEGIN PGP SIGNED MESSAGE- Moin, On Tuesday 09 September 2003 19:08, Tony Bowden wrote: > On Tue, Sep 09, 2003 at 05:49:47PM +0100, Fergal Daly wrote: > Most of the time people shouldn't care. If the thing is sufficiently > masquerading as a type 5 widget you shouldn't care - that's purel

Re: Test::More and 'deep' tests

2003-09-09 Thread Tony Bowden
On Tue, Sep 09, 2003 at 05:49:47PM +0100, Fergal Daly wrote: > > my $str1 = MyString->new("foo", "bar"); > > my $str2 = MyOtherString->new("foo", "baz"); > > Now they _do_ differ by more than just class and it should be a fail, although > I must admit that even with the current is_deeply it will

Re: Test::More and 'deep' tests

2003-09-09 Thread Fergal Daly
On Tuesday 09 September 2003 15:29, Tony Bowden wrote: > On Tue, Sep 09, 2003 at 01:25:22PM +0100, Adrian Howard wrote: > > >1) ok $str1 eq $str2; > > >2) is $str1, $str2; > > >3) is_deeply [$str1], [$str2]; > > >4) is_deeply $str1, $str2; > > All should pass as far as I am concerned. I agree. The

Re: Test::More and 'deep' tests

2003-09-09 Thread Tels
-BEGIN PGP SIGNED MESSAGE- Moin, On Tuesday 09 September 2003 16:29, Tony Bowden wrote: > On Tue, Sep 09, 2003 at 01:25:22PM +0100, Adrian Howard wrote: > > >1) ok $str1 eq $str2; > > >2) is $str1, $str2; > > >3) is_deeply [$str1], [$str2]; > > >4) is_deeply $str1, $str2; > > > > All shou

Re: Test::More and 'deep' tests

2003-09-09 Thread Ovid
My opinion: those is_deeply() tests should probably not pass. While on the surface it may appear that they should, I would argue that this is a case where the programmer writing the tests needs to know enough about the system he or she is building to create tests that accurately reflect how th

Re: Test::More and 'deep' tests

2003-09-09 Thread Adrian Howard
On Tuesday, Sep 9, 2003, at 10:52 Europe/London, Tony Bowden wrote: [snip] 1) ok $str1 eq $str2; 2) is $str1, $str2; 3) is_deeply [$str1], [$str2]; 4) is_deeply $str1, $str2; All should pass as far as I am concerned. The Test::More deeply behaviour matches my intuitions, and I would have tests th

Re: Test::More and 'deep' tests

2003-09-09 Thread Tony Bowden
On Tue, Sep 09, 2003 at 01:25:22PM +0100, Adrian Howard wrote: > >1) ok $str1 eq $str2; > >2) is $str1, $str2; > >3) is_deeply [$str1], [$str2]; > >4) is_deeply $str1, $str2; > All should pass as far as I am concerned. OK - what if it was slightly more complex: package MyString; use overload

Re: Test::More and 'deep' tests

2003-09-09 Thread Tony Bowden
On Tue, Sep 09, 2003 at 01:07:00PM +0100, Fergal Daly wrote: > The question needs changing. Both versions of is_deeply will give the same > answer on these tests. But do you agree that they should all pass? If so I've completely misunderstood your earlier arguments. They certainly aren't "deepl

Re: Test::More and 'deep' tests

2003-09-09 Thread Fergal Daly
The question needs changing. Both versions of is_deeply will give the same answer on these tests. I was going to say: What you need is package MyOtherString; use overload '""' => sub { shift->[0] }, fallback => 1; sub new { my ($class, $val) = @_; bless [ $val ], $class; } But actuall

Test::More and 'deep' tests

2003-09-09 Thread Tony Bowden
There's been a protracted discussion on the code-review mailing list about the behaviour of is_deeply in Test::More, which really belongs here or p5p. For the most part it was sparked by a disagreement about what should happen when comparing overloaded objects (but also then impacts on tied objec