diff options
author | Jim Meyering <jim@meyering.net> | 1997-06-01 17:16:23 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1997-06-01 17:16:23 +0000 |
commit | f5291be83ebb53294afd9a9c0186e21c539c1ac7 (patch) | |
tree | 00b29492fbf99efe2850f6f8ba09d5d5b2e2ec67 /tests/date/Test.pm | |
parent | 2c0e561933fe84475495f217a7c42bc61dabdd05 (diff) | |
download | coreutils-f5291be83ebb53294afd9a9c0186e21c539c1ac7.tar.xz |
Add tests using `next'.
Diffstat (limited to 'tests/date/Test.pm')
-rw-r--r-- | tests/date/Test.pm | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/date/Test.pm b/tests/date/Test.pm index 1eb9eaf07..d83240b49 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... ); |