@@ -, +, @@ --- t/db_dependent/Calendar.t | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) --- a/t/db_dependent/Calendar.t +++ a/t/db_dependent/Calendar.t @@ -150,7 +150,13 @@ subtest 'hours_between | days_between' => sub { subtest 'Different hours' => sub { - plan tests => 8; + plan tests => 10; + + # Between 5th and 5th (Same day short hours loan) + my $diff_hours = $calendar->hours_between( $now, $now->clone->add(hours => 3) )->hours; + is( $diff_hours, 3, '' ); + my $diff_days = $calendar->days_between( $now, $now->clone->add(hours => 3) )->delta_days; + is( $diff_days, 0, '' ); # Between 5th and 6th my $diff_hours = $calendar->hours_between( $now, $nov_6->clone->subtract(hours => 3) )->hours; @@ -233,6 +239,9 @@ subtest 'hours_between | days_between' => sub { my ( $diff_hours, $diff_days ); + # Between 5th and 5th (Same day short hours loan) + # No test - one cannot issue on a holiday and we do not yet record opening hours to take those into account + # Between 5th and 6th my $duration = $calendar->hours_between( $now, $nov_6->clone->subtract(hours => 3) ); is( $duration->hours, abs(0 * 24 - 3), '' ); # FIXME $duration->hours always return a abs --