From b52e6430fcc4a286824c5fe775d45dc2fdeeb24f Mon Sep 17 00:00:00 2001 From: Joe Atzberger Date: Sat, 12 Jan 2008 07:25:00 -0600 Subject: [PATCH] Dates - remove extra newlines from carps, add partial "00" date tests to Dates.t Signed-off-by: Chris Cormack Signed-off-by: Joshua Ferraro --- C4/Dates.pm | 6 +++--- t/Dates.t | 11 ++++++----- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/C4/Dates.pm b/C4/Dates.pm index f45fd79f3f..15e854d440 100644 --- a/C4/Dates.pm +++ b/C4/Dates.pm @@ -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)"; } } diff --git a/t/Dates.t b/t/Dates.t index c1db4baba7..755c390ca7 100755 --- a/t/Dates.t +++ b/t/Dates.t @@ -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); -- 2.39.5