tests: stat: check an empty --format or --printf

* tests/stat/stat-printf.pl (f-empty, f-empty2, f-empty-terse)
(p-empty, fs-empty): New tests, ensuring an empty format is used
rather than the default one.

https://github.com/uutils/coreutils/pull/16451

Link: https://github.com/coreutils/coreutils/pull/464
This commit is contained in:
Sylvestre Ledru authored and Pádraig Brady committed 2026-11-15 16:17:39 +00:00
1 parent 2da43a03b6
commit d66f7dc609
1 file changed
+6
+6
View File
@@ -45,6 +45,12 @@ my @Tests =
# With --format, there *is* a trailing newline.
['f-nl', "--format=%n .", {OUT=>".\n"}],
['f-nl2', "--format=%n . .", {OUT=>".\n.\n"}],
# An empty format is used, not the default one.
['f-empty', "--format='' .", {OUT=>"\n"}],
['f-empty2', "-c '' . .", {OUT=>"\n\n"}],
['f-empty-terse', "-t -c '' .", {OUT=>"\n"}],
['p-empty', "--printf='' .", {OUT=>""}],
['fs-empty', "-f -c '' .", {OUT=>"\n"}],
['end-pct', "--printf=% .", {OUT=>"%"}],
['pct-pct', "--printf=%% .", {OUT=>"%"}],