From: Jim Meyering Date: Sun, 1 Jun 1997 17:16:23 +0000 (+0000) Subject: Add tests using `next'. X-Git-Tag: SH-UTILS-1_16a~58 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f5291be83ebb53294afd9a9c0186e21c539c1ac7;p=thirdparty%2Fcoreutils.git Add tests using `next'. --- diff --git a/tests/date/Test.pm b/tests/date/Test.pm index 1eb9eaf079..d83240b492 100644 --- a/tests/date/Test.pm +++ b/tests/date/Test.pm @@ -15,6 +15,15 @@ sub test_vector my $d0 = '1997-01-19'; my $d1 = "$d0 $t0 +0"; + my $ts = '08:17:49'; # next second + my $tm = '08:18:48'; # next minute + my $th = '09:17:48'; # next hour + + my $dd = '1997-01-20'; # next day + my $dw = '1997-01-26'; # next week + my $dm = '1997-02-19'; # next month + my $dy = '1998-01-19'; # next month + my $fmt = "'+%Y-%m-%d %T'"; my @tvec = @@ -66,6 +75,14 @@ sub test_vector ['rel-3a', "-d '$d1 4 seconds ago' $fmt", {}, "$d0 08:17:44", 0], + ['next-s', "-d '$d1 next second' '+%Y-%m-%d %T'", {}, "$d0 $ts", 0], + ['next-m', "-d '$d1 next minute' '+%Y-%m-%d %T'", {}, "$d0 $tm", 0], + ['next-h', "-d '$d1 next hour' '+%Y-%m-%d %T'", {}, "$d0 $th", 0], + ['next-d', "-d '$d1 next day' '+%Y-%m-%d %T'", {}, "$dd $t0", 0], + ['next-w', "-d '$d1 next week' '+%Y-%m-%d %T'", {}, "$dw $t0", 0], + ['next-mo', "-d '$d1 next month' '+%Y-%m-%d %T'", {}, "$dm $t0", 0], + ['next-y', "-d '$d1 next year' '+%Y-%m-%d %T'", {}, "$dy $t0", 0], + # FIXME: add a lot more... );