in reply to DateTime::Span intersection inconsistencies
It therefore looks as though one nanosecond is going missing somewhere.
Is this intentional -- am I missing something to do with DateTime::Duration objects, or is this down to a bug in one of the DateTime modules?
I inserted this near the failing test
and it produceduse DDS; diag Dump( $span->duration, $duration );
So it apperas that DateTime::Duration->compare is not normalizing the units so the comparison fails. I consider this a bug.# $DateTime_Duration1 = { # days => 0, # end_of_month # => 'wrap', # minutes => 0, # months => 0, # nanoseconds # => 0, # seconds => 3600 # }; # $DateTime_Duration2 = { # days => 0, # end_of_month # => 'wrap', # minutes => 60, # months => 0, # nanoseconds # => 0, # seconds => 0 # }; # bless( $DateTime_Duration1, 'DateTime::Duration' ); # bless( $DateTime_Duration2, 'DateTime::Duration' );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: DateTime::Span intersection inconsistencies
by mikeman (Acolyte) on Jun 30, 2011 at 13:51 UTC | |
by Anonymous Monk on Jun 30, 2011 at 14:35 UTC |