On Wed, Apr 19, 2006, Niko Tyni wrote: > tags 355982 fixed-upstream > thanks
tags 355982 patch thanks dude > On Thu, Mar 09, 2006 at 05:34:06AM +0000, Martin Michlmayr wrote: > this is CPAN #16632, fixed in 0.30. It was apparently caused by a change > in Test::More wrt. stringifying objects when comparing. I backported the changes to 0.29 and I am intending to NMU it in the current BSP with the following changes (also see attachment). --- libdatetime-perl-0.2901/debian/changelog +++ libdatetime-perl-0.2901/debian/changelog @@ -1,3 +1,10 @@ +libdatetime-perl (1:0.2901-1.1) unstable; urgency=low + + * Non-maintainer upload during BSP + * Backport fix to CPAN RT #16632 from 0.30. Closes: #355982. + + -- Mohammed Adnène Trojette <[EMAIL PROTECTED]> Mon, 24 Apr 2006 02:04:39 +0200 + libdatetime-perl (1:0.2901-1) unstable; urgency=low * New upstream release. Closes: #314939. -- adn Mohammed Adnène Trojette
diff -u libdatetime-perl-0.2901/debian/changelog libdatetime-perl-0.2901/debian/changelog --- libdatetime-perl-0.2901/debian/changelog +++ libdatetime-perl-0.2901/debian/changelog @@ -1,3 +1,10 @@ +libdatetime-perl (1:0.2901-1.1) unstable; urgency=low + + * Non-maintainer upload during BSP + * Backport fix to CPAN RT #16632 from 0.30. Closes: #355982. + + -- Mohammed Adnène Trojette <[EMAIL PROTECTED]> Mon, 24 Apr 2006 02:04:39 +0200 + libdatetime-perl (1:0.2901-1) unstable; urgency=low * New upstream release. Closes: #314939. --- libdatetime-perl-0.2901.orig/t/20infinite.t +++ libdatetime-perl-0.2901/t/20infinite.t @@ -2,11 +2,7 @@ use strict; -use Test::More; - -# XXX - hack alert - still need to really fix this -my $is_win32 = $^O =~ /win32/i ? 1 : 0; -plan tests => $is_win32 ? 39 : 40; +use Test::More tests => 42; use DateTime; @@ -55,7 +51,7 @@ my $dur = $pos - $pos; my %deltas = $dur->deltas; - my @compare = $is_win32 ? ( qw( days seconds ) ) : ( qw( days seconds nanoseconds ) ); + my @compare = qw( days seconds nanoseconds ); foreach (@compare) { is( $deltas{$_}, $nan, "infinity - infinity = nan ($_)" ); @@ -115,3 +111,8 @@ ok( $neg == $neg2, "-infinity (datetime) == -infinity (datetime)" ); } + +{ + cmp_ok( "$pos", 'eq', $posinf, 'stringified infinity (datetime) eq infinity (number)' ); + cmp_ok( "$neg", 'eq', $neginf, 'stringified neg infinity (datetime) eq neg infinity (number)' ); +} only in patch2: unchanged: --- libdatetime-perl-0.2901.orig/lib/DateTime.pm +++ libdatetime-perl-0.2901/lib/DateTime.pm @@ -58,7 +58,7 @@ use overload ( 'fallback' => 1, '<=>' => '_compare_overload', 'cmp' => '_compare_overload', - '""' => 'format_datetime', + '""' => '_stringify', '-' => '_subtract_overload', '+' => '_add_overload', ); @@ -721,7 +721,7 @@ return DateTime->_accumulated_leap_seconds( $self->{utc_rd_days} ); } -sub format_datetime +sub _stringify { my $self = shift; only in patch2: unchanged: --- libdatetime-perl-0.2901.orig/lib/DateTime/Infinite.pm +++ libdatetime-perl-0.2901/lib/DateTime/Infinite.pm @@ -27,6 +27,11 @@ return ($_[1]) x 3; } +sub _stringify { ( $_[0]->{utc_rd_days} == DateTime::INFINITY + ? DateTime::INFINITY . '' + : DateTime::NEG_INFINITY . '' + ) } + sub STORABLE_freeze { return } sub STORABLE_thaw { return }