mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-17 18:02:09 +03:00
tests: stat: check the 0 flag with a precision
* tests/stat/stat-fmt.sh: Ensure an integer conversion with a precision ignores the 0 flag, as printf does. https://github.com/uutils/coreutils/pull/16368 Link: https://github.com/coreutils/coreutils/pull/462
This commit is contained in:
1 parent
8d32a0aadb
commit
2da43a03b6
1 file changed
+12
@@ -107,6 +107,18 @@ abc%Ndef'\''
|
||||
EOF
|
||||
compare exp out || fail=1
|
||||
|
||||
# An integer conversion with a precision ignores the 0 flag.
|
||||
printf 'hello world\n' > f || framework_failure_
|
||||
chmod 644 f || framework_failure_
|
||||
mode=$(stat -c %f f) || framework_failure_
|
||||
for fmt in %08.4s %08s %08.0s %08.s %08.4a %08.4f %08.4h; do
|
||||
stat --printf="$fmt|" f >> out-0 || fail=1
|
||||
done
|
||||
printf ' 0012|00000012| 12| 12| 0644|%8.4x| 0001|' \
|
||||
"0x$mode" > exp \
|
||||
|| framework_failure_
|
||||
compare exp out-0 || 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
|
||||
|
||||
Reference in new issue
Block a user