Does this test/patch perform the behaviour that you would want? Or
should something different be returned?
Just a thought!
-Brook
diff -c Business-Hours-0.06.new/lib/Business/Hours.pm
Business-Hours-0.06.realnew/lib/Business/Hours.pm
*** Business-Hours-0.06.new/lib/Business/Hours.pm Wed Jul 30
01:09:22 2003
--- Business-Hours-0.06.realnew/lib/Business/Hours.pm Wed Jul 30
01:15:15 2003
***************
*** 224,229 ****
--- 224,237 ----
is(cardinality $hours_span, (9 * $answers[$i] * 60 * 60));
}
+ #Check for negative time
+ $hours_span = $hours->for_timespan(Start => 32_400, End => 86_400);
+ is(ref($hours_span), 'Set::IntSpan');
+ $hours_span = $hours->for_timespan(Start => 86_400, End => 86_400);
+ is(ref($hours_span), 'Set::IntSpan');
+ $hours_span = $hours->for_timespan(Start => 86_400, End => 32_400);
+ isnt(ref($hours_span), 'Set::IntSpan');
+
=end testing
=cut
***************
*** 235,240 ****
--- 243,250 ----
End => undef,
@_ );
+ return -1 if ($args{'Start'} > $args{'End'});
+
my $bizdays;
if ( $self->{'business_hours'} ) {
$bizdays = $self->{'business_hours'};