]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: date: test format options combined with format strings
authorCollin Funk <collin.funk1@gmail.com>
Fri, 15 May 2026 07:49:01 +0000 (00:49 -0700)
committerCollin Funk <collin.funk1@gmail.com>
Fri, 15 May 2026 07:49:01 +0000 (00:49 -0700)
* tests/date/date.pl (@Tests): Add a few test cases.

tests/date/date.pl

index 8e4ac1044e6cc28bac4c0c817f2db014343e8d65..187c7c6e95c41ad61ff21b69abc011889cd20b4f 100755 (executable)
@@ -387,6 +387,20 @@ my @Tests =
      ['multiple-iso3', "--iso-8601=minutes --iso-8601=hours -d '2026-05-11'",
       {OUT=>"2026-05-11T00+00:00"}],
 
+     # Test that using both a format string and format option fails.
+     ['multiple-fmt1', "--iso-8601 -d '2026-05-15' +'%Y'",
+      {ERR => "date: multiple output formats specified\n"},
+      {EXIT => 1},
+     ],
+     ['multiple-fmt2', "--rfc-email -d '2026-05-15' +'%Y'",
+      {ERR => "date: multiple output formats specified\n"},
+      {EXIT => 1},
+     ],
+     ['multiple-fmt3', "--rfc-3339=date -d '2026-05-15' +'%Y'",
+      {ERR => "date: multiple output formats specified\n"},
+      {EXIT => 1},
+     ],
+
     );
 
 $limits->{TIME_T_MAX} == $limits->{INTMAX_MAX}