]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
tests: Fix lang-javascript failure on Ubuntu 26.04. master
authorBruno Haible <bruno@clisp.org>
Mon, 10 Aug 2026 19:55:01 +0000 (21:55 +0200)
committerBruno Haible <bruno@clisp.org>
Mon, 10 Aug 2026 19:55:01 +0000 (21:55 +0200)
* gettext-tools/tests/lang-javascript: Don't test in the ${LOCALE_FR} locale.

gettext-tools/tests/lang-javascript

index 71529e504cac5995584743a99712a028e6db174a..6724b5f3afc272d751b3b31a22be4fbbcd93d3c0 100755 (executable)
@@ -78,21 +78,12 @@ case "$host_os" in
   darwin*) echo "Skipping test: gjs gettext module possibly broken"; Exit 77;;
 esac
 
   darwin*) echo "Skipping test: gjs gettext module possibly broken"; Exit 77;;
 esac
 
-# Test which of the fr_FR locales are installed.
 : ${LOCALE_FR=fr_FR}
 : ${LOCALE_FR_UTF8=fr_FR.UTF-8}
 : ${LOCALE_FR=fr_FR}
 : ${LOCALE_FR_UTF8=fr_FR.UTF-8}
-# gjs on macOS supports only UTF-8 locales.
-case "$host_os" in
-  darwin*) LOCALE_FR=none ;;
-esac
-if test $LOCALE_FR != none; then
-  LC_ALL=$LOCALE_FR ../testlocale
-  case $? in
-    0) ;;
-    77) LOCALE_FR=none;;
-    *) Exit 1;;
-  esac
-fi
+# As of 2026, gjs in the ${LOCALE_FR} locale produces ISO-8859-1 encoded output
+# when stdout is a terminal, but UTF-8 encoded output when stdout is redirected
+# to a file or to a pipe. This prevents us from testing this case. We can only
+# test ${LOCALE_FR_UTF8}.
 if test $LOCALE_FR_UTF8 != none; then
   LC_ALL=$LOCALE_FR_UTF8 ../testlocale
   case $? in
 if test $LOCALE_FR_UTF8 != none; then
   LC_ALL=$LOCALE_FR_UTF8 ../testlocale
   case $? in
@@ -101,34 +92,25 @@ if test $LOCALE_FR_UTF8 != none; then
     *) Exit 1;;
   esac
 fi
     *) Exit 1;;
   esac
 fi
-if test $LOCALE_FR = none && test $LOCALE_FR_UTF8 = none; then
+if test $LOCALE_FR_UTF8 = none; then
   if test -f /usr/bin/localedef; then
   if test -f /usr/bin/localedef; then
-    echo "Skipping test: no french locale is installed"
+    echo "Skipping test: no french Unicode locale is installed"
   else
   else
-    echo "Skipping test: no french locale is supported"
+    echo "Skipping test: no french Unicode locale is supported"
   fi
   Exit 77
 fi
 
 : ${DIFF=diff}
 cat <<\EOF > prog.ok
   fi
   Exit 77
 fi
 
 : ${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
 
 «Votre commande, s'il vous plait», dit le garçon.
 EUR remplace FF.
 EOF
 
-: ${LOCALE_FR=fr_FR}
 : ${LOCALE_FR_UTF8=fr_FR.UTF-8}
 : ${LOCALE_FR_UTF8=fr_FR.UTF-8}
-if test $LOCALE_FR != none; then
-  LANGUAGE= LC_ALL=$LOCALE_FR gjs prog.js > 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 gjs prog.js > prog.out || Exit 1
 if test $LOCALE_FR_UTF8 != none; then
   LANGUAGE= LC_ALL=$LOCALE_FR_UTF8 gjs prog.js > prog.out || Exit 1
-  ${DIFF} prog.oku prog.out || Exit 1
+  ${DIFF} prog.ok prog.out || Exit 1
 fi
 
 Exit 0
 fi
 
 Exit 0