From: Pádraig Brady
Date: Sun, 20 Mar 2022 17:46:13 +0000 (+0000)
Subject: tests: improve recent printf test
X-Git-Tag: v9.1~29
X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=500c697cc85b7c1ec6ca4e329331cf3c6fc8f2ab;p=thirdparty%2Fcoreutils.git
tests: improve recent printf test
* tests/misc/printf-mb.sh: Given we shortcut the single char
(invalid multi-byte) case, add a case to ensure we're correctly
checking the return from mbrtowc().
---
diff --git a/tests/misc/printf-mb.sh b/tests/misc/printf-mb.sh
index ad21dbe67e..69ed3dfe84 100755
--- a/tests/misc/printf-mb.sh
+++ b/tests/misc/printf-mb.sh
@@ -34,17 +34,21 @@ if test "$LOCALE_FR_UTF8" != "none"; then
LC_ALL=C $prog '%04x\n' "'$($prog '\xe1')" >>out 2>>err
#valid multi-byte, with trailing
LC_ALL=$f $prog '%04x\n' '"á"' >>out 2>>err
+ #invalid multi-byte, with trailing
+ LC_ALL=$f $prog '%04x\n' "'$($prog '\xe1')'" >>out 2>>err
)
cat <<\EOF > exp || framework_failure_
00e1
00e1
00e1
00e1
+00e1
EOF
compare exp out || fail=1
cat <