Skip Menu |
 

This queue is for tickets about the Business-Hours CPAN distribution.

Report information
The Basics
Id: 3075
Status: new
Priority: 0/
Queue: Business-Hours

People
Owner: Nobody in particular
Requestors: leira [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



Subject: don't die becaue Set::Intspan creation dies
Download (untitled) / with headers
text/plain 135b
For instance, if you call for_timespan with an end time earlier than the start time, it will die. It should return an error instead.
Date: Wed, 30 Jul 2003 01:17:30 +1000
Subject: [cpan #3075] don't die becaue Set::Intspan creation dies
From: Brook Schofield <brooksch [...] mac.com>
To: bug-business-hours [...] rt.cpan.org
RT-Send-Cc:
Download (untitled) / with headers
text/plain 1.1k
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'};


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.