From 9fb2a03a63138c694afb4e7c5bfe707e4b097bdf Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Thu, 29 Oct 2026 21:30:39 +0100 Subject: [PATCH] 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 --- tests/stat/stat-printf.pl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/stat/stat-printf.pl b/tests/stat/stat-printf.pl index 52206aa23..4f02df6ee 100755 --- a/tests/stat/stat-printf.pl +++ b/tests/stat/stat-printf.pl @@ -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};