]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
Add tests for %U, %V, and %W and for a bug fixed on 1996-03-05.
authorJim Meyering <jim@meyering.net>
Wed, 19 Feb 1997 03:23:16 +0000 (03:23 +0000)
committerJim Meyering <jim@meyering.net>
Wed, 19 Feb 1997 03:23:16 +0000 (03:23 +0000)
Remove misleading `-' from leap-1 test.

tests/date/Test.pm

index bfd972e1a9fac2c01bebd64134be8a0cff9c403d..faacee958b1cb815233e7b29720a0816cbed3dc5 100644 (file)
@@ -6,7 +6,7 @@ use strict;
 # For each test...
 # Export LANG=C so that the locale-dependent strings match.
 # Export TZ=UTC so that zone-dependent strings match.
-$Test::default_env = ['LANG=C TZ=UTC'];
+$Test::env_default = ['LANG=C TZ=UTC'];
 
 sub test_vector
 {
@@ -26,7 +26,25 @@ sub test_vector
      ['8', "-d '$d1' +'%x_%X_%y_%Y'", {}, '01/19/97_08:17:48_97_1997', 0],
      ['9', "-d '$d1' +'%z_%Z'", {}, '+0000_GMT', 0],
 
-     ['leap-1', "--date '02/29/1996 - 1 year' +%Y-%m-%d", {}, '1997-03-01', 0],
+     ['leap-1', "--date '02/29/1996 1 year' +%Y-%m-%d", {}, '1997-03-01', 0],
+
+     ['U95-1', "--date '1995-1-1' +%U", {}, '01', 0],
+     ['U95-2', "--date '1995-1-7' +%U", {}, '01', 0],
+     ['U95-3', "--date '1995-1-8' +%U", {}, '02', 0],
+
+     ['U92-1', "--date '1992-1-1' +%U", {}, '00', 0],
+     ['U92-2', "--date '1992-1-4' +%U", {}, '00', 0],
+     ['U92-3', "--date '1992-1-5' +%U", {}, '01', 0],
+
+     ['V92-1', "--date '1992-1-1' +%V", {}, '01', 0],
+     ['V92-2', "--date '1992-1-5' +%V", {}, '01', 0],
+     ['V92-3', "--date '1992-1-6' +%V", {}, '02', 0],
+
+     ['W92-1', "--date '1992-1-1' +%W", {}, '00', 0],
+     ['W92-2', "--date '1992-1-5' +%W", {}, '00', 0],
+     ['W92-3', "--date '1992-1-6' +%W", {}, '01', 0],
+
+     ['millen-1', "--date '1998-1-1 3 years' +%Y", {}, '2001', 0],
 
      # FIXME: add a lot more...
      );
@@ -41,7 +59,7 @@ sub test_vector
     }
   # Verify that the test-script generation code properly handles
   # per-test overrides.
-  $Test::env{2} = ['LANG=C TZ=GMT'];
+  $Test::env{9} = ['LANG=C TZ=GMT'];
 
   return @tv;
 }