Dates - remove extra newlines from carps, add partial "00" date tests to Dates.t

Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
This commit is contained in:
Joe Atzberger 2008-01-12 07:25:00 -06:00 committed by Joshua Ferraro
parent c82636958d
commit b52e6430fc
2 changed files with 9 additions and 8 deletions

View file

@ -77,7 +77,7 @@ sub dmy_map ($$) {
return @{$aref};
}
# $debug and
carp "Illegal Date '$val' does not match '$dformat' format: " . $self->visual() . "\n";
carp "Illegal Date '$val' does not match '$dformat' format: " . $self->visual();
return 0;
}
@ -85,11 +85,11 @@ sub _check_date_and_time {
my $chron_ref = shift;
my ($year, $month, $day) = _chron_to_ymd($chron_ref);
unless (check_date($year, $month, $day)) {
carp "Illegal date specified (year = $year, month = $month, day = $day)\n";
carp "Illegal date specified (year = $year, month = $month, day = $day)";
}
my ($hour, $minute, $second) = _chron_to_hms($chron_ref);
unless (check_time($hour, $minute, $second)) {
carp "Illegal time specified (hour = $hour, minute = $minute, second = $second)\n";
carp "Illegal time specified (hour = $hour, minute = $minute, second = $second)";
}
}

View file

@ -3,7 +3,7 @@
use strict;
use warnings;
use Test::More tests => 92;
use Test::More tests => 126;
BEGIN {
use FindBin;
use lib $FindBin::Bin;
@ -18,11 +18,12 @@ sub describe ($$) {
}
my %thash = (
iso => ['2001-01-01','1989-09-21'],
metric => ["01-01-2001",'21-09-1989'],
us => ["01-01-2001",'09-21-1989'],
iso => ['2001-01-01','1989-09-21','1952-01-00'],
metric => ["01-01-2001",'21-09-1989','00-01-1952'],
us => ["01-01-2001",'09-21-1989','01-00-1952'],
sql => ['20010101 010101',
'19890921 143907' ],
'19890921 143907',
'19520100 000000' ],
);
my ($date, $format, $today, $today0, $val, $re, $syspref);