]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: date: test time zone format strings with space padding
authorCollin Funk <collin.funk1@gmail.com>
Sun, 14 Jun 2026 22:55:55 +0000 (15:55 -0700)
committerCollin Funk <collin.funk1@gmail.com>
Sun, 14 Jun 2026 23:19:06 +0000 (16:19 -0700)
* tests/date/date.pl (@Tests): Add a few test cases.

tests/date/date.pl

index 53d65f83690d3f7ae951dda65450c2da8d59f73c..95547e8b10ad2055ea29a1fcda0e3cd4f219b945 100755 (executable)
@@ -237,6 +237,13 @@ my @Tests =
 
      ['tz-5', '+%:z', {OUT=>"-00:01"}, {ENV=>'TZ=XXX0:01'}],
 
+     # Test time zone format strings with space padding.
+     ['tz-underscore-1', '+%_z', {OUT=>'   +0'}],
+     ['tz-underscore-2', '+%_:z', {OUT=>' +0:00'}],
+     ['tz-underscore-3', '+%_::z', {OUT=>' +0:00:00'}],
+     ['tz-underscore-4', '+%_:::z', {OUT=>' +0'}],
+     ['tz-underscore-5', '+%_::::z', {OUT=>'%_::::z'}],
+
      # Accept %:z with a field width before the ':'.
      ['tz-5w','+%8:z', {OUT=>"-0000:01"}, {ENV=>'TZ=XXX0:01'}],
      # Don't recognize %:z with a field width between the ':' and the 'z'.