From: Sylvestre Ledru Date: Mon, 6 Apr 2026 16:10:42 +0000 (+0100) Subject: test: od: verify -t f defaults to double precision X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fac454616bbc77b453fa5e193b06aff1a6c819c1;p=thirdparty%2Fcoreutils.git test: od: verify -t f defaults to double precision * tests/od/od-float.sh: Add cases to ensure -t f = -t fD, and also verify the resulting number. https://github.com/uutils/coreutils/pull/11396 https://github.com/coreutils/coreutils/pull/241 --- diff --git a/tests/od/od-float.sh b/tests/od/od-float.sh index 3894aea8af..6b547945c0 100755 --- a/tests/od/od-float.sh +++ b/tests/od/od-float.sh @@ -90,4 +90,19 @@ else compare exp_err err || fail=1 fi +# Ensure -t f defaults to double precision (8 bytes), not float (4 bytes). +env printf '\x00\x00\x80\x3f\x00\x00\x00\x40' | +od -An -t f --endian=little > out || fail=1 +printf ' 2.000000473111868\n' > exp || framework_failure_ +compare exp out || fail=1 + +env printf '\x00\x00\x80\x3f\x00\x00\x00\x40' | +od -An -t fD --endian=little > out || fail=1 +compare exp out || fail=1 + +env printf '\x00\x00\x80\x3f\x00\x00\x00\x40' | +od -An -t fF --endian=little > out || fail=1 +printf ' 1 2\n' > exp || framework_failure_ +compare exp out || fail=1 + Exit $fail