David Dyck wrote:

The following test failed
not ok 7 - recurrence with time zone
not ok 10 - recurrence with time zone, arg without time zone
not ok 12 - recurrence with time zone, arg with time zone
not ok 13 - default locale
not ok 14 - new locale


The most common errors reported were on line 338
 count   error message
363 _callback_previous: Delta components are: months 0 days 0 minutes 0 seconds 0 nanoseconds 0 333 _callback_previous: iterator can't find a previous value, got 2001-12-31 after 2001-12-31 at /hdd1/jd/usr2/dcd/CPAN/build/DateTime-Set-0.23/blib/lib/DateTime/Set.pm line 338. 10 _callback_previous: iterator can't find a previous value, got 2002-02-01 after 2002-01-01 at /hdd1/jd/usr2/dcd/CPAN/build/DateTime-Set-0.23/blib/lib/DateTime/Set.pm line 338. 8 _callback_previous: iterator can't find a previous value, got 2001-12-31 after 2001-12-02 at /hdd1/jd/usr2/dcd/CPAN/build/DateTime-Set-0.23/blib/lib/DateTime/Set.pm line 338. 5 _callback_previous: iterator can't find a previous value, got 2002-01-01 after 2001-12-01 at /hdd1/jd/usr2/dcd/CPAN/build/DateTime-Set-0.23/blib/lib/DateTime/Set.pm line 338. 5 _callback_previous: iterator can't find a previous value, got 2001-12-01 after 2001-11-22 at /hdd1/jd/usr2/dcd/CPAN/build/DateTime-Set-0.23/blib/lib/DateTime/Set.pm line 338. 2 _callback_previous: iterator can't find a previous value, got 2001-12-02 after 2001-11-21 at /hdd1/jd/usr2/dcd/CPAN/build/DateTime-Set-0.23/blib/lib/DateTime/Set.pm line 338.

if I ignore error messages with '_callback_previous:'
 the failures were:

1..14
not ok 7 - recurrence with time zone
#   Failed test 'recurrence with time zone'
#   in t/15time_zone.t at line 60.
#          got: '2001-12-02T00:00:00 Asia/Taipei'
#     expected: '2001-12-01T00:00:00 Asia/Taipei'
not ok 10 - recurrence with time zone, arg without time zone
#   Failed test 'recurrence with time zone, arg without time zone'
#   in t/15time_zone.t at line 87.
#          got: '2001-12-02T00:00:00 Asia/Taipei'
#     expected: '2001-12-01T00:00:00 Asia/Taipei'
not ok 12 - recurrence with time zone, arg with time zone
#   Failed test 'recurrence with time zone, arg with time zone'
#   in t/15time_zone.t at line 102.
#          got: '2001-12-01T14:00:00 America/Sao_Paulo'
#     expected: '2001-11-30T14:00:00 America/Sao_Paulo'
not ok 13 - default locale
#   Failed test 'default locale'
#   in t/15time_zone.t at line 119.
#          got: 'Mon'
#     expected: 'Sun'
not ok 14 - new locale
#   Failed test 'new locale'
#   in t/15time_zone.t at line 124.
#          got: 'Mon'
#     expected: 'Sun'
# Looks like you failed 5 tests of 14.



Any ideas on where I should look?
  David



David:

Thank you for offering to help!

Those tests failures are related to a change in the way the DateTime.pm module deals with add/subtract in objects that have timezones.

We have been discussing how to fix this for a while, in the DateTime list (would you like to join in? - see: http://datetime.perl.org/mailing_list.html )

On the other hand, these failures only happen in these tests - no other DateTime::Set derived modules seem to be affected. Maybe the tests should simply be skipped?

In any case, the error is caused by the calculation in DateTime::Set line 325 - the calculated offset doesn't work near DST changes, because (t/15time_zone.t line 49):

     $_[0]->truncate( to => 'month' )->add( months => 1 );

instead of returning next month, it returns the same month/day ???
More specifically, adding 1 month to 2001-10-01T00:00:00 yields 2001-10-31T00:00:00 - which is the same month.

In short, the test can be fixed, but the error is actually in the way the timezone math is done, or I'm misinterpreting the DateTime.pm math (which is quite possible)

Thank you.

(cc'ing the DateTime list)

- Flavio

Reply via email to