]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: improve recent printf test
authorPádraig Brady <P@draigBrady.com>
Sun, 20 Mar 2022 17:46:13 +0000 (17:46 +0000)
committerPádraig Brady <P@draigBrady.com>
Sun, 20 Mar 2022 17:46:13 +0000 (17:46 +0000)
* 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().

tests/misc/printf-mb.sh

index ad21dbe67ef8c2f195f31b6927e1ab8ff6a0d82a..69ed3dfe845f26475113bc7d13591eff1a007019 100755 (executable)
@@ -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 <<EOF > exp_err
 printf: warning: ": character(s) following character constant have been ignored
+printf: warning: ': character(s) following character constant have been ignored
 EOF
   compare exp_err err || fail=1
 fi