diff options
Diffstat (limited to 'gettext-tools/tests/lang-python-1')
-rwxr-xr-x | gettext-tools/tests/lang-python-1 | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/gettext-tools/tests/lang-python-1 b/gettext-tools/tests/lang-python-1 index 7801b2c..40b686e 100755 --- a/gettext-tools/tests/lang-python-1 +++ b/gettext-tools/tests/lang-python-1 @@ -2,6 +2,10 @@ # Test of gettext facilities 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 @@ -72,16 +76,30 @@ case `python -c 'import sys; print sys.hexversion >= 0x20000F0'` 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. EUR remplace FF. EOF +cat <<\EOF > prog.oku +«Votre commande, s'il vous plait», dit le garçon. +EUR remplace FF. +EOF : ${LOCALE_FR=fr_FR} -LANGUAGE= LC_ALL=$LOCALE_FR python prog.py > 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 > 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 > 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 |