tests: stat: ensure the last of stat's --printf and --format wins

Reported at https://github.com/uutils/coreutils/issues/15993

* tests/stat/stat-printf.pl: Add test cases.

Link: https://github.com/coreutils/coreutils/pull/436
This commit is contained in:
Sylvestre Ledru authored and Pádraig Brady committed 2026-11-07 12:35:10 +00:00
1 parent 5316d1ec95
commit 9fb2a03a63
1 file changed
+4
+4
View File
@@ -67,6 +67,10 @@ my @Tests =
# and --format adds no trailing newline when it stops early.
['err-6', "--format=a%9 .", {OUT=>"a"}, {EXIT => 1},
{ERR=>"$prog: '%9': invalid directive\n"}],
# The last of --printf and --format wins.
['format-last', "--printf=X --format=Y .", {OUT=>"Y\n"}],
['printf-last', "--format=Y --printf=X .", {OUT=>"X"}],
);
my $save_temps = $ENV{DEBUG};