Debian Codegraph @

gnulib-tests/test-c32tolower.sh

raw
1 #!/bin/sh
2
3 # Allow distinguishing the various invocations in the .log file.
4 set -x
5
6 # Test in the POSIX locale.
7 LC_ALL=C ${CHECKER} ./test-c32tolower${EXEEXT} 0 || exit 1
8 LC_ALL=POSIX ${CHECKER} ./test-c32tolower${EXEEXT} 0 || exit 1
9
10 # Test in an ISO-8859-1 or ISO-8859-15 locale.
11 : "${LOCALE_FR=fr_FR}"
12 if test $LOCALE_FR != none; then
13 LC_ALL=$LOCALE_FR \
14 ${CHECKER} ./test-c32tolower${EXEEXT} 1 \
15 || exit 1
16 fi
17
18 # Test whether a specific EUC-JP locale is installed.
19 : "${LOCALE_JA=ja_JP}"
20 if test $LOCALE_JA != none; then
21 LC_ALL=$LOCALE_JA \
22 ${CHECKER} ./test-c32tolower${EXEEXT} 2 \
23 || exit 1
24 fi
25
26 # Test whether a specific UTF-8 locale is installed.
27 : "${LOCALE_EN_UTF8=en_US.UTF-8}"
28 : "${LOCALE_FR_UTF8=fr_FR.UTF-8}"
29 if test "$LOCALE_EN_UTF8" != none || test $LOCALE_FR_UTF8 != none; then
30 # It's sufficient to test in one of the two locales.
31 if test $LOCALE_FR_UTF8 != none; then
32 testlocale=$LOCALE_FR_UTF8
33 else
34 testlocale="$LOCALE_EN_UTF8"
35 fi
36 LC_ALL="$testlocale" \
37 ${CHECKER} ./test-c32tolower${EXEEXT} 3 \
38 || exit 1
39 fi
40
41 # Test whether a specific GB18030 locale is installed.
42 : "${LOCALE_ZH_CN=zh_CN.GB18030}"
43 if test $LOCALE_ZH_CN != none; then
44 LC_ALL=$LOCALE_ZH_CN \
45 ${CHECKER} ./test-c32tolower${EXEEXT} 4
46 case $? in
47 0 | 77) ;;
48 *) exit 1 ;;
49 esac
50 fi
51
52 exit 0