Lines 203-209
subtest 'hours_between | days_between' => sub {
Link Here
|
203 |
|
203 |
|
204 |
my ( $diff_hours, $diff_days ); |
204 |
my ( $diff_hours, $diff_days ); |
205 |
|
205 |
|
206 |
# Between 5th and 6th |
206 |
# Between 5th and 6th (This case should never happen in real code, one cannot return on a closed day) |
207 |
$diff_hours = $calendar->hours_between( $now, $nov_6 )->hours; |
207 |
$diff_hours = $calendar->hours_between( $now, $nov_6 )->hours; |
208 |
is( $diff_hours, 0 * 24, '' ); # FIXME Is this really should be 0? |
208 |
is( $diff_hours, 0 * 24, '' ); # FIXME Is this really should be 0? |
209 |
$diff_days = $calendar->days_between( $now, $nov_6)->delta_days; |
209 |
$diff_days = $calendar->days_between( $now, $nov_6)->delta_days; |
Lines 240-248
subtest 'hours_between | days_between' => sub {
Link Here
|
240 |
my ( $diff_hours, $diff_days ); |
240 |
my ( $diff_hours, $diff_days ); |
241 |
|
241 |
|
242 |
# Between 5th and 5th (Same day short hours loan) |
242 |
# Between 5th and 5th (Same day short hours loan) |
243 |
# No test - one cannot issue on a holiday and we do not yet record opening hours to take those into account |
243 |
# No test - Tested above as 5th is an open day |
244 |
|
244 |
|
245 |
# Between 5th and 6th |
245 |
# Between 5th and 6th (This case should never happen in real code, one cannot return on a closed day) |
246 |
my $duration = $calendar->hours_between( $now, $nov_6->clone->subtract(hours => 3) ); |
246 |
my $duration = $calendar->hours_between( $now, $nov_6->clone->subtract(hours => 3) ); |
247 |
is( $duration->hours, abs(0 * 24 - 3), '' ); # FIXME $duration->hours always return a abs |
247 |
is( $duration->hours, abs(0 * 24 - 3), '' ); # FIXME $duration->hours always return a abs |
248 |
is( $duration->is_negative, 1, ); # FIXME Do really test for that case in our calls to hours_between? |
248 |
is( $duration->is_negative, 1, ); # FIXME Do really test for that case in our calls to hours_between? |
249 |
- |
|
|