[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 10/10] tests: stat: check %#a adds a single leading 0
|
From: |
Pádraig Brady |
|
Subject: |
[PATCH 10/10] tests: stat: check %#a adds a single leading 0 |
|
Date: |
Sun, 15 Nov 2026 16:20:13 +0000 |
From: Sylvestre Ledru <sylvestre@debian.org>
* tests/stat/stat-fmt.sh: Check %#a with various precisions and
widths, including for a mode of 0.
https://github.com/uutils/coreutils/pull/16393
Link: https://github.com/coreutils/coreutils/pull/463
---
tests/stat/stat-fmt.sh | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/tests/stat/stat-fmt.sh b/tests/stat/stat-fmt.sh
index 3138327d1..d79f47a8d 100755
--- a/tests/stat/stat-fmt.sh
+++ b/tests/stat/stat-fmt.sh
@@ -119,6 +119,16 @@ printf ' 0012|00000012| 12| 12|
0644|%8.4x| 0001|' \
|| framework_failure_
compare exp out-0 || fail=1
+# %#a adds a single leading 0.
+touch f z || framework_failure_
+chmod 644 f && chmod 0 z || framework_failure_
+stat -c '%#a|%#.4a|%#.5a|%#.2a|%#8.4a' f z > out || fail=1
+cat <<\EOF >exp
+0644|0644|00644|0644| 0644
+0|0000|00000|00| 0000
+EOF
+compare exp out || fail=1
+
# ensure %H and %L modifiers are handled
stat -c '%r %R %Hd,%Ld %Hr,%Lr' . > out || fail=1
grep -F '?' out && fail=1
--
2.56.0
- [PATCH 01/10] tests: fmt: add -t tests with a one-line paragraph, Pádraig Brady, 2026/11/15
- [PATCH 06/10] tests: join: check -o fields after the file operands, Pádraig Brady, 2026/11/15
- [PATCH 07/10] tests: seq: check -w with scientific notation, Pádraig Brady, 2026/11/15
- [PATCH 04/10] tests: stat: check the 0 flag with a precision, Pádraig Brady, 2026/11/15
- [PATCH 05/10] tests: stat: check an empty --format or --printf, Pádraig Brady, 2026/11/15
- [PATCH 08/10] tests: expand: check the column is kept across files and buffers, Pádraig Brady, 2026/11/15
- [PATCH 10/10] tests: stat: check %#a adds a single leading 0,
Pádraig Brady <=
- [PATCH 02/10] tests: dircolors: check TERM filtering of the built-in database, Pádraig Brady, 2026/11/15
- [PATCH 03/10] tests: pr: check -m with a separator and a page width, Pádraig Brady, 2026/11/15
- [PATCH 09/10] tests: nl: check option values starting with a hyphen, Pádraig Brady, 2026/11/15