diff options
Diffstat (limited to 'gettext-tools/tests/lang-python-2')
-rwxr-xr-x | gettext-tools/tests/lang-python-2 | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/gettext-tools/tests/lang-python-2 b/gettext-tools/tests/lang-python-2 index 5719f4b..70f889a 100755 --- a/gettext-tools/tests/lang-python-2 +++ b/gettext-tools/tests/lang-python-2 @@ -3,6 +3,10 @@ # Test of gettext facilities (including plural handling) in the Python # language. +# Note: This test fails with Python 2.3, 2.4 when an UTF-8 locale is present. +# It looks like a bug in Python's gettext.py. This here is a quick workaround: +LOCALE_FR_UTF8=none + tmpfiles="" trap 'rm -fr $tmpfiles' 1 2 3 15 @@ -91,17 +95,32 @@ case `python -c 'import sys; print sys.hexversion >= 0x20300F0'` in *) rm -fr $tmpfiles; exit 77;; esac -tmpfiles="$tmpfiles prog.ok prog.out" +tmpfiles="$tmpfiles prog.ok prog.oku prog.out" : ${DIFF=diff} cat <<\EOF > prog.ok «Votre commande, s'il vous plait», dit le garçon. 2 morceaux de gateau EUR remplace FF. EOF +cat <<\EOF > prog.oku +«Votre commande, s'il vous plait», dit le garçon. +2 morceaux de gateau +EUR remplace FF. +EOF : ${LOCALE_FR=fr_FR} -LANGUAGE= LC_ALL=$LOCALE_FR python prog.py 2 > prog.out || exit 1 -${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 python prog.py 2 > prog.out || exit 1 + ${DIFF} prog.ok prog.out || exit 1 +fi +if test $LOCALE_FR_UTF8 != none; then + LANGUAGE= LC_ALL=$LOCALE_FR_UTF8 python prog.py 2 > prog.out || exit 1 + ${DIFF} prog.oku prog.out || exit 1 +fi +if test $LOCALE_FR = none && test $LOCALE_FR_UTF8 = none; then + rm -fr $tmpfiles; exit 77 +fi rm -fr $tmpfiles |