# along with this program. If not, see <https://www.gnu.org/licenses/>.
. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
-print_ver_ sleep
+print_ver_ sleep printf
getlimits_
# invalid timeouts
returns_ 124 timeout 0.1 sleep inf || fail=1
returns_ 124 timeout 0.1 sleep $LDBL_MAX || fail=1
+# Test locale decimal handling for printf, sleep, timeout
+: ${LOCALE_FR_UTF8=none}
+if test "$LOCALE_FR_UTF8" != "none"; then
+ f=$LOCALE_FR_UTF8
+ locale_decimal=$(LC_ALL=$f env printf '%0.3f' 0.001) || fail=1
+ locale_decimal=$(LC_ALL=$f env printf '%0.3f' "$locale_decimal") || fail=1
+ case "$locale_decimal" in
+ 0?001)
+ LC_ALL=$f timeout 1$locale_decimal sleep "$locale_decimal" || fail=1 ;;
+ *) fail=1 ;;
+ esac
+fi
+
Exit $fail