Skip Menu |
 

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

Report information
The Basics
Id: 60324
Status: resolved
Priority: 0/
Queue: DBIx-Class

People
Owner: Nobody in particular
Requestors: MARKLE [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.08123
Fixed in: 0.08124



Subject: t/96_is_deteministic_value.t incompatible with DateTime 0.53
Download (untitled) / with headers
text/plain 2.7k
It looks like you need to require a more recent version of DateTime. With 0.53 installed (the default in yum in CentOS), it got the errors below. I updated to the more recent DateTime 0.61 version and it works fine. 0.53 stringification/numification overloading must not have recognized the operator context correctly. Thanks. --mark-- { my $formatter = DateTime::Format::Strptime->new(pattern => '%Y'); my $dt = DateTime->new(year => 2006, month => 06, day => 06, formatter => $formatter ); my $cd; lives_ok { $cd = $cd_rs->search({ year => $dt})->create ({ artist => {name => 'Guillermo2'}, title => 'Guillermo 2', }); }; my $year = $cd->year; diag("year is '$year'"); diag("year reftype is '".ref($year)."'"); is($cd->year, 2006); # ok($cd->year == 2006); ok("$year" == 2006, 'stringify datetime before == comparison with an integer'); is($cd->year, '2006', 'use Test::More::is to compare dt to string "2006"'); ok($year eq '2006', 'use eq to compare dt to string "2006"'); } hedges@vm5:~/src/DBIx-Class-0.08123$ prove -v t/96_is_deteministic_value.t t/96_is_deteministic_value.t .. ok 1 # year is '1999' # year reftype is '' ok 2 ok 3 # year is '2006' # year reftype is 'DateTime' not ok 4 # Failed test at t/96_is_deteministic_value.t line 48. # got: '2006' # expected: '2006' ok 5 - stringify datetime before == comparison with an integer not ok 6 - use Test::More::is to compare dt to string "2006" # Failed test 'use Test::More::is to compare dt to string "2006"' # at t/96_is_deteministic_value.t line 51. # got: '2006' # expected: '2006' not ok 7 - use eq to compare dt to string "2006" # Failed test 'use eq to compare dt to string "2006"' # at t/96_is_deteministic_value.t line 52. ok 8 ok 9 ok 10 ok 11 1..11 # Looks like you failed 3 tests of 11. Dubious, test returned 3 (wstat 768, 0x300) Failed 3/11 subtests Test Summary Report ------------------- t/96_is_deteministic_value.t (Wstat: 768 Tests: 11 Failed: 3) Failed tests: 4, 6-7 Non-zero exit status: 3 Files=1, Tests=11, 1 wallclock secs ( 0.01 usr 0.04 sys + 0.51 cusr 0.40 csys = 0.96 CPU) Result: FAIL hedges@vm5:~/src/DBIx-Class-0.08123$ prove -v t/96_is_deteministic_value.t t/96_is_deteministic_value.t .. ok 1 # year is '1999' # year reftype is '' ok 2 ok 3 # year is '2006' # year reftype is 'DateTime' ok 4 ok 5 - stringify datetime before == comparison with an integer ok 6 - use Test::More::is to compare dt to string "2006" ok 7 - use eq to compare dt to string "2006" ok 8 ok 9 ok 10 ok 11 1..11 ok All tests successful. Files=1, Tests=11, 1 wallclock secs ( 0.02 usr 0.03 sys + 0.50 cusr 0.37 csys = 0.92 CPU) Result: PASS
Download (untitled) / with headers
text/plain 622b
On Fri Aug 13 20:49:11 2010, MARKLE wrote: Show quoted text
> It looks like you need to require a more recent version of DateTime. > With 0.53 installed (the default in yum in CentOS), it got the errors > below. I updated to the more recent DateTime 0.61 version and it works > fine. 0.53 stringification/numification overloading must not have > recognized the operator context correctly. Thanks. --mark--
Downgrading to DateTime 0.53 on a test system did not result in any problems. Please share the versions of all your DateTime modules present in INC at test-end, so we can properly pinpoint which module needs a specific version.
Download (untitled) / with headers
text/plain 259b
As an additional data point, I saw a similar test failure with the following module versions installed: * DateTime 0.42 * DateTime::Locale 0.35 * DateTime::TimeZone 0.7701 Upgrading to versions 0.61, 0.45 and 1.20, respectively, remedied the problem.
Download (untitled) / with headers
text/plain 374b
I had only one version of DateTime installed on the system. Before DateTime, I had also tried upgrading DateTime::Format::Strptime, which also upgraded DateTime::Locale. Maybe it was the combination of old DateTime and old DateTime::Locale that caused the error. There are a lot of things screwy with perl on CentOS that I can never seem to find an explanation for. Mark
Download (untitled) / with headers
text/plain 235b
Now DT 0.55 is the lowest allowed for DT-related tests (we can't have it as a hard-require however): http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=dbsrgits/DBIx-Class.git;a=commitdiff;h=68de943862f06cabd397d2e74d12cd9cdc999779 Cheers


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

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