diff options
author | Bruno Haible <bruno@clisp.org> | 2019-12-26 12:29:20 +0100 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2019-12-27 00:18:17 +0100 |
commit | a43a04acff6b6ab02f17769063e8a85ae978a0bc (patch) | |
tree | e68a2f7223a03affdc5945668644c15ff43e79b4 /tests/init.sh | |
parent | 6bc5c0e01ba63d0fd8557d26fb468a2e61f129da (diff) | |
download | gnulib-a43a04acff6b6ab02f17769063e8a85ae978a0bc.tar.gz |
test-framework-sh: Avoid /bin/sh on AIX 7.2 due to its printf built-in.
Reported by Paul Eggert in
<https://lists.gnu.org/archive/html/grep-devel/2019-12/msg00020.html>.
Simplification by Jim Meyering.
* tests/init.sh (gl_shell_test_script_): Add a test of printf of an
octal escape sequence in a UTF-8 locale.
Diffstat (limited to 'tests/init.sh')
-rw-r--r-- | tests/init.sh | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/init.sh b/tests/init.sh index 8ca5c90551..049e0d359c 100644 --- a/tests/init.sh +++ b/tests/init.sh @@ -129,6 +129,8 @@ else fi # We require $(...) support unconditionally. +# We require that the printf built-in work correctly regarding octal escapes; +# this eliminates /bin/sh on AIX 7.2. # We require non-surprising "local" semantics (this eliminates dash). # This takes the admittedly draconian step of eliminating dash, because the # assignment tab=$(printf '\t') works fine, yet preceding it with "local " @@ -158,6 +160,12 @@ fi # ? - not ok gl_shell_test_script_=' test $(echo y) = y || exit 1 +LC_ALL=en_US.UTF-8 printf "\\351" 2>/dev/null \ + | LC_ALL=C tr "\\351" x | LC_ALL=C grep x > /dev/null \ + || exit 1 +printf "\\351" 2>/dev/null \ + | LC_ALL=C tr "\\351" x | LC_ALL=C grep x > /dev/null \ + || exit 1 f_local_() { local v=1; }; f_local_ || exit 1 f_dash_local_fail_() { local t=$(printf " 1"); }; f_dash_local_fail_ score_=10 |