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 +0000, 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

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

Test::Set

2003-02-27 Thread Fergal Daly
f $this and $that are equal as sets and false otherwise. =cut sub eq_math_set { my ($this, $that) = @_; my ($extra, $missing) = _diff_bagset($this, $that, 1); (@$extra or @$missing) ? 0 : 1; } =item B eq_bag([EMAIL PROTECTED], [EMAIL PROTECTED]); This performs the same test as is_bag b

Test::More diagostics problem

2003-02-27 Thread Fergal Daly
There's a line missing from Test::More::_deep_check(). It results in funny diagnostics after comparing scalar refs, so perl -MTest::More=no_plan -e 'is_deeply([(\"a") x 5, "b"], [(\"a") x 5, "c"])' gives # Structures begin differing at: # $got->[0][1][2][3][4][5] = 'b' # $exp

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 +0000, 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 > > c

[PATCH] circular data structures in Test::More

2003-03-03 Thread Fergal Daly
This patch lets Test::More compare circular data structures. Get the latest version (0.47) of Test::More, apply fixes.patch to fix some issues, then apply circular.patch. Test with circular.t, F -- Do you need someone with lots of Unix sysadmin and/or lots of OO software development experienc

Re: Test::Set

2003-02-28 Thread Fergal Daly
On Friday 28 February 2003 12:23, Adrian Howard wrote: > Comments: > > - I'd prefer is_set rather than is_math_set So would I but eq_set is already taken by Test::More and I want to name the is_ and the eq_ functions conistently > - I'd like shallow comparison options as well as deep one

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 yo

One more Test::More problem

2003-02-27 Thread Fergal Daly
Final one tonight! eq_array and eq_hash don't tidy up after themselves. You would have to be very unfortunate to be stung by this problem but potentially you could end up with extra references to some of your variables which could effect tests further on due to DESTROYs not being called or what

Meta testing

2003-03-02 Thread Fergal Daly
I'm writing test a test module and naturally I want to test it. 2 minutes ago I discovered Test::Builder::Tester but before finding that I spent several hours inventing a slightly different wheel... twice. The result is Test::Tester http://www.fergaldaly.com/computer/Test-Tester/ It's not com

Problem with Test::More and Does Not Exist

2003-03-03 Thread Fergal Daly
perl -MTest::More=no_plan -e 'is_deeply({}, {key => []})' should fail but doesn't because $DNE is deeply equal to [] and _deep_check doesn't notice the class difference. Patch attached. F -- Do you need someone with lots of Unix sysadmin and/or lots of OO software development experience? Go

Test::Deep 0.02

2003-03-19 Thread Fergal Daly
Hi, I've just uploaded Test::Deep 0.02 to CPAN. This module is a very souped up version of the is_deeply() test from Test::More. If you don't include an special comparison instructions, it behaves exactly like is_deeply() except it handles circular data structures and it compares the cla