From 5757f7f4d8493dfa34ece58e6bb3ae41f4e48224 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Tue, 15 Feb 2005 14:48:11 +0000 Subject: Perform the lang-* tests both in a traditional locale and in a UTF-8 locale, as far as provided by the system. --- gettext-tools/tests/lang-bash | 53 ++++++++++++++++++++++++++++++++----------- 1 file changed, 40 insertions(+), 13 deletions(-) (limited to 'gettext-tools/tests/lang-bash') diff --git a/gettext-tools/tests/lang-bash b/gettext-tools/tests/lang-bash index 0fff7e3..f9397b0 100755 --- a/gettext-tools/tests/lang-bash +++ b/gettext-tools/tests/lang-bash @@ -89,16 +89,30 @@ case `bash -c 'echo $BASH_VERSION'` in *) rm -fr $tmpfiles; exit 77;; esac -# Test whether the fr_FR locale is installed. +# Test which of the fr_FR locales are installed. : ${LOCALE_FR=fr_FR} -LC_ALL=$LOCALE_FR ./testlocale -case $? in - 0) ;; - 77) rm -fr $tmpfiles; exit 77;; - *) exit 1;; -esac - -tmpfiles="$tmpfiles prog.nok prog.ok prog.out" +: ${LOCALE_FR_UTF8=fr_FR.UTF-8} +if test $LOCALE_FR != none; then + LC_ALL=$LOCALE_FR ./testlocale + case $? in + 0) ;; + 77) LOCALE_FR=none;; + *) exit 1;; + esac +fi +if test $LOCALE_FR_UTF8 != none; then + LC_ALL=$LOCALE_FR_UTF8 ./testlocale + case $? in + 0) ;; + 77) LOCALE_FR_UTF8=none;; + *) exit 1;; + esac +fi +if test $LOCALE_FR = none && test $LOCALE_FR_UTF8 = none; then + rm -fr $tmpfiles; exit 77 +fi + +tmpfiles="$tmpfiles prog.nok prog.ok prog.oku prog.out" # Expected result when bash is built without i18n support. cat <<\EOF > prog.nok 'Your command, please?', asked the waiter. @@ -109,12 +123,25 @@ cat <<\EOF > prog.ok «Votre commande, s'il vous plait», dit le garçon. 2 morceaux de gateau EOF +cat <<\EOF > prog.oku +«Votre commande, s'il vous plait», dit le garçon. +2 morceaux de gateau +EOF : ${LOCALE_FR=fr_FR} -LANGUAGE= LC_ALL=$LOCALE_FR bash ./prog.sh 2 > prog.out || exit 1 -: ${DIFF=diff} -${DIFF} prog.nok prog.out > /dev/null && { rm -fr $tmpfiles; exit 77; } -${DIFF} prog.ok prog.out || exit 1 +: ${LOCALE_FR_UTF8=fr_FR.UTF-8} +if test $LOCALE_FR != none; then + LANGUAGE= LC_ALL=$LOCALE_FR bash ./prog.sh 2 > prog.out || exit 1 + : ${DIFF=diff} + ${DIFF} prog.nok prog.out > /dev/null && { rm -fr $tmpfiles; exit 77; } + ${DIFF} prog.ok prog.out || exit 1 +fi +if test $LOCALE_FR_UTF8 != none; then + LANGUAGE= LC_ALL=$LOCALE_FR_UTF8 bash ./prog.sh 2 > prog.out || exit 1 + : ${DIFF=diff} + ${DIFF} prog.nok prog.out > /dev/null && { rm -fr $tmpfiles; exit 77; } + ${DIFF} prog.oku prog.out || exit 1 +fi rm -fr $tmpfiles -- cgit v1.1