This queue is for tickets about the Class-DBI CPAN distribution.

Report information
The Basics
Id:
3690
Status:
resolved
Priority:
Low/Low
Queue:

People
Owner:
Nobody in particular
Requestors:
merlyn [...] stonehenge.com
Cc:
AdminCc:

BugTracker
Severity:
Important
Broken in:
0.94
Fixed in:
(no value)



Subject: 0.94 tests broken on 5.8.1-to-be on OSX 10.2.6
merlyn% make test TEST_FILES=t/01-columns.t PERL_DL_NONLAZY=1 /usr/local/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/01-columns.t t/01-columns....NOK 3# Failed test (t/01-columns.t at line 44) # Structures begin differing at: # $got->[0] = name # $expected->[0] = 'name' t/01-columns....NOK 4# Failed test (t/01-columns.t at line 46) # Structures begin differing at: # $got->[0] = abbreviation # $expected->[0] = 'abbreviation' t/01-columns....NOK 5# Failed test (t/01-columns.t at line 48) # Structures begin differing at: # $got->[0] = abbreviation # $expected->[0] = 'abbreviation' t/01-columns....NOK 7# Failed test (t/01-columns.t at line 53) # Structures begin differing at: # $got->[0] = artist # $expected->[0] = 'artist' t/01-columns....NOK 8# Failed test (t/01-columns.t at line 55) # Structures begin differing at: # $got->[0] = artist # $expected->[0] = 'artist' t/01-columns....NOK 9# Failed test (t/01-columns.t at line 57) # Structures begin differing at: # $got->[0] = artist # $expected->[0] = 'artist' t/01-columns....ok 35/35# Looks like you failed 6 tests of 35. t/01-columns....dubious Test returned status 6 (wstat 1536, 0x600) DIED. FAILED tests 3-5, 7-9 Failed 6/35 tests, 82.86% okay Failed Test Stat Wstat Total Fail Failed List of Failed ------------------------------------------------------------------------------- t/01-columns.t 6 1536 35 6 17.14% 3-5 7-9 Failed 1/1 test scripts, 0.00% okay. 6/35 subtests failed, 82.86% okay. make: *** [test_dynamic] Error 6
Date: Mon, 1 Sep 2003 19:38:10 +0100
From: Tony Bowden <tony@kasei.com>
To: Randal_L_Schwartz via RT <bug-Class-DBI@rt.cpan.org>
Subject: Re: [cpan #3690] 0.94 tests broken on 5.8.1-to-be on OSX 10.2.6
RT-Send-Cc:
On Mon, Sep 01, 2003 at 09:20:01AM -0400, Randal_L_Schwartz via RT wrote:
Show quoted text
> This message about Class-DBI was sent to you by MERLYN <MERLYN@cpan.org> via rt.cpan.org
Thanks for this, but I have no idea what might be causing this, as it works fine for me on all my machines... It looks like a very bizarre error as well... Any chance of a 'perl -Ilib t/01-columns.t' style output report? Thanks, Tony
Show quoted text
> PERL_DL_NONLAZY=1 /usr/local/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/01-columns.t > t/01-columns....NOK 3# Failed test (t/01-columns.t at line 44) > # Structures begin differing at: > # $got->[0] = name > # $expected->[0] = 'name' > t/01-columns....NOK 4# Failed test (t/01-columns.t at line 46) > # Structures begin differing at: > # $got->[0] = abbreviation > # $expected->[0] = 'abbreviation' > t/01-columns....NOK 5# Failed test (t/01-columns.t at line 48) > # Structures begin differing at: > # $got->[0] = abbreviation > # $expected->[0] = 'abbreviation' > t/01-columns....NOK 7# Failed test (t/01-columns.t at line 53) > # Structures begin differing at: > # $got->[0] = artist > # $expected->[0] = 'artist' > t/01-columns....NOK 8# Failed test (t/01-columns.t at line 55) > # Structures begin differing at: > # $got->[0] = artist > # $expected->[0] = 'artist' > t/01-columns....NOK 9# Failed test (t/01-columns.t at line 57) > # Structures begin differing at: > # $got->[0] = artist > # $expected->[0] = 'artist' > t/01-columns....ok 35/35# Looks like you failed 6 tests of 35. > t/01-columns....dubious > Test returned status 6 (wstat 1536, 0x600) > DIED. FAILED tests 3-5, 7-9 > Failed 6/35 tests, 82.86% okay > Failed Test Stat Wstat Total Fail Failed List of Failed > ------------------------------------------------------------------------------- > t/01-columns.t 6 1536 35 6 17.14% 3-5 7-9 > Failed 1/1 test scripts, 0.00% okay. 6/35 subtests failed, 82.86% okay. > make: *** [test_dynamic] Error 6
Date: Mon, 1 Sep 2003 17:16:38 -0700
From: Michael G Schwern <schwern@pobox.com>
To: Tony Bowden via RT <bug-Class-DBI@rt.cpan.org>
CC: "AdminCc of cpan Ticket #3690": ;
Subject: Re: [cpan #3690] 0.94 tests broken on 5.8.1-to-be on OSX 10.2.6
RT-Send-Cc:
On Mon, Sep 01, 2003 at 02:38:48PM -0400, Tony Bowden via RT wrote:
Show quoted text
> Thanks for this, but I have no idea what might be causing this, as it > works fine for me on all my machines...
It might have been this: http://public.activestate.com/cgi-bin/perlbrowse?patch=20465 Possibly tickled by the "mixed ref and stringified ref" fix. Let me install a recent bleadperl and investigate. -- Michael G Schwern schwern@pobox.com http://www.pobox.com/~schwern/ Stupid am I? Stupid like a fox!
From: Fergal Daly <fergal@esatclear.ie>
To: bug-Class-DBI@rt.cpan.org
Subject: Re: Fwd: [bug-Class-DBI@rt.cpan.org: [cpan #3690] 0.94 tests broken on 5.8.1-to-be on OSX 10.2.6]
Date: Tue, 2 Sep 2003 15:51:32 +0100
RT-Send-Cc:
My suspicions were confirmed, it's an overload problem. I think it may be best fixed by rewriting the test (see below) because I'm not sure we can revert to the old is_deeply behaviour without unfixing another bug. The best thing might be to rewrite the tests in question. They look like is_deeply [ State->columns('Primary') ] => [qw/name/], 'State Primary:' . join ", ", State->columns('Primary'); They're not really deep tests, so they could be rewritten as ok((@ret = State->columns('Primary')) == 1, "State primary return size"); is_eq($ret[0], "name", "State Primary return string"); which is not much longer, makes the string comparison explicit and gives nicer diagnostics. It doesn't include the tested value in the name of the test as that's not going to be much use if the value is wrong. It will appear in is_eq's diagnostics anyway if the test fails. The reason I say rewrite the tests rather than twiddle is_deeply is twofold - I think the old behaviour was wrong and I think the old behaviour is impossible to implement correctly. I think the old behaviour was genuinely a bug because is_deeply is about static data, not behaviour. I don't think is_deeply should be calling functions (albeit implicitly) that can potentially change the data it's comparing and so it should never stringify an overloaded ref. String comparison should be explicit (it is in Test::Deep) that's why we have is_eq and is_num. The old code would do string comparison if either side was a string. I suppose putting a string into the expected value could be thought of as explicitly requesting string comparison (although there's no way to request numerical comparison, so why allow string?). However I think the occurrence of a string in the got value should definitely not force string comparison, the expected value should be "in control". Breaking things (especially test modules) purely for my idea of "correctness" is not a good idea. However in this case it may not be possible to put things back without unfixing another bug: is_deeply($ref, $ref."", "arghh should be a fail!") I thought maybe I could avoid that by checking if $ref overloads "" and if it does then doing a string comparison but on reading the overload docs, there's no way to tell if an object overloads "", you can only find out that it overloads something. So the above test die on overloaded refs that don't overload "". Maybe it's accessible somehow but I don't think we want is_deeply digging around in the guts of overload and I certainly don't fancy evalling and checking why it died. Even if you did figure out a nice way, I think documenting this aspect of is_deeply would be quite confusing, which is always a sign that something's a bad idea. What do you think? F
Date: Tue, 2 Sep 2003 13:31:44 -0700
From: Michael G Schwern <schwern@pobox.com>
To: Fergal Daly via RT <bug-Class-DBI@rt.cpan.org>
CC: "AdminCc of cpan Ticket #3690": ;
Subject: Re: Fwd: [bug-Class-DBI@rt.cpan.org: [cpan #3690] 0.94 tests broken on 5.8.1-to-be on OSX 10.2.6]
RT-Send-Cc:
On Tue, Sep 02, 2003 at 10:52:15AM -0400, Fergal Daly via RT wrote:
Show quoted text
> My suspicions were confirmed, it's an overload problem. I think it may be best > fixed by rewriting the test (see below) because I'm not sure we can revert to > the old is_deeply behaviour without unfixing another bug. > > The best thing might be to rewrite the tests in question. They look like > > is_deeply [ State->columns('Primary') ] => [qw/name/], > 'State Primary:' . join ", ", State->columns('Primary');
This should work. The test should not ignore stringification otherwise you can't do black box testing using is_deeply(). Put another way, the Class::DBI API says that columns() returns a list of column names as strings. There's nothing about them being objects. When writing the test we should not have to be aware that they are really objects with stringification overloaded.
Show quoted text
> I thought maybe I could avoid that by checking if $ref overloads "" and if it > does then doing a string comparison but on reading the overload docs, there's > no way to tell if an object overloads "", you can only find out that it > overloads something.
overload::Method($thing, '""'); or if for some reason that doesn't work, this is a pretty good heuristic: $stringification_overloaded = overload::StrVal($thing) ne "$thing"; -- Michael G Schwern schwern@pobox.com http://www.pobox.com/~schwern/ Any sufficiently encapsulated hack is no longer a hack.
The patch to 5.8.1 which caused this problem has now been backed out again. I assume that this closes the bug (for now...)


This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.