summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2022-04-11 13:47:44 +0100
committerPádraig Brady <P@draigBrady.com>2022-04-11 15:46:57 +0100
commit021fc4fad2cd6712d03af090431dbef353968a30 (patch)
tree0d20915f33ce1cf6519ad65e6be8db0c940536d5 /tests
parent046ab76166bfe946fa701e1a93ac69e1c69d5a13 (diff)
downloadcoreutils-021fc4fad2cd6712d03af090431dbef353968a30.tar.gz
tests: printf-mb.sh: fix false failure with french translations
* tests/misc/printf-mb.sh: As per commit 04148c99c, adjust non C warnings before comparison, to those of LC_MESSAGES=C. Reported by Adam Sampson
Diffstat (limited to 'tests')
-rwxr-xr-xtests/misc/printf-mb.sh18
1 files changed, 13 insertions, 5 deletions
diff --git a/tests/misc/printf-mb.sh b/tests/misc/printf-mb.sh
index 69ed3dfe8..f2f32c8a7 100755
--- a/tests/misc/printf-mb.sh
+++ b/tests/misc/printf-mb.sh
@@ -33,9 +33,9 @@ if test "$LOCALE_FR_UTF8" != "none"; then
#uni-byte
LC_ALL=C $prog '%04x\n' "'$($prog '\xe1')" >>out 2>>err
#valid multi-byte, with trailing
- LC_ALL=$f $prog '%04x\n' '"á"' >>out 2>>err
+ LC_ALL=$f $prog '%04x\n' '"á=' >>out 2>>err
#invalid multi-byte, with trailing
- LC_ALL=$f $prog '%04x\n' "'$($prog '\xe1')'" >>out 2>>err
+ LC_ALL=$f $prog '%04x\n' "'$($prog '\xe1')=" >>out 2>>err
)
cat <<\EOF > exp || framework_failure_
00e1
@@ -46,11 +46,19 @@ if test "$LOCALE_FR_UTF8" != "none"; then
EOF
compare exp out || fail=1
+ # Disparate LC_CTYPE and LC_MESSAGES problematic on macos,
+ # so just look for character in warning message,
+ # and normalize to LC_MESSAGES=C
+ C_WARNING='printf: '\
+'warning: =: character(s) following character constant have been ignored'
+
+ sed "s/printf:.*=.*/$C_WARNING/" < err > c_err || framework_failure_
+
cat <<EOF > exp_err
-printf: warning: ": character(s) following character constant have been ignored
-printf: warning: ': character(s) following character constant have been ignored
+$C_WARNING
+$C_WARNING
EOF
- compare exp_err err || fail=1
+ compare exp_err c_err || fail=1
fi
Exit $fail