Dates - remove extra newlines from carps, add partial "00" date tests to Dates.t
authorJoe Atzberger <joe.atzberger@liblime.com>
Sat, 12 Jan 2008 13:25:00 +0000 (07:25 -0600)
committerJoshua Ferraro <jmf@liblime.com>
Mon, 14 Jan 2008 22:45:31 +0000 (16:45 -0600)
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
C4/Dates.pm
t/Dates.t

index f45fd79..15e854d 100644 (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)";
     }
 }
 
index c1db4ba..755c390 100755 (executable)
--- 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);