2 # tests for printing multi-byte values of characters
4 # Copyright (C) 2022-2024 Free Software Foundation, Inc.
6 # This program is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program. If not, see <https://www.gnu.org/licenses/>.
19 .
"${srcdir=.}/tests/init.sh"; path_prepend_ .
/src
25 if test "$LOCALE_FR_UTF8" != "none"; then
29 LC_ALL
=$f $prog '%04x\n' '"á' >>out
2>>err
31 LC_ALL
=$f $prog '%04x\n' "'$($prog '\xe1')" >>out
2>>err
33 LC_ALL
=C
$prog '%04x\n' "'$($prog '\xe1')" >>out
2>>err
34 #valid multi-byte, with trailing
35 LC_ALL
=$f $prog '%04x\n' '"á=' >>out
2>>err
36 #invalid multi-byte, with trailing
37 LC_ALL
=$f $prog '%04x\n' "'$($prog '\xe1')=" >>out
2>>err
39 cat <<\EOF
> exp || framework_failure_
46 compare exp out || fail
=1
48 # Disparate LC_CTYPE and LC_MESSAGES problematic on macos,
49 # so just look for character in warning message,
50 # and normalize to LC_MESSAGES=C
52 'warning: =: character(s) following character constant have been ignored'
54 sed "s/printf:.*=.*/$C_WARNING/" < err
> c_err || framework_failure_
60 compare exp_err c_err || fail
=1