From 540e52b9eda529ccd0597b479aa8fe678803eccb Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sat, 25 Jun 2016 22:34:50 -0600 Subject: [PATCH] tests: mb-charclass-non-utf8: avoid false-failure * testsuite/mb-charclass-non-utf8.sh: Detect OS X's bogus ja_JP.SJIS locale and skip this test in that case, rather than failing. Reported by Assaf Gordon in http://lists.gnu.org/archive/html/sed-devel/2016-06/msg00029.html --- testsuite/mb-charclass-non-utf8.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/testsuite/mb-charclass-non-utf8.sh b/testsuite/mb-charclass-non-utf8.sh index 0a4617a..cf92859 100755 --- a/testsuite/mb-charclass-non-utf8.sh +++ b/testsuite/mb-charclass-non-utf8.sh @@ -26,6 +26,15 @@ require_ja_shiftjis_locale_ fail=0 +# In the ja_JP.SJIS locale, \203\060 is an invalid multi-byte sequence, yet +# in OS X's implementation of that locale, it is mistakenly interpreted as +# valid. That problem would cause false failure of this test, so detect it +# and skip this entire test on such systems instead. + +# If wc -m declares that it is a single character, skip this test. +n=$(printf '\203\060'|LC_ALL=$LOCALE_JA_SJIS wc -m) +test "$n" = 1 && skip_ "your $LOCALE_JA_SJIS locale is broken" + # This test uses two characters: # Unicode Character 'KATAKANA LETTER ZE' (U+30BC) # Unicode Character 'KATAKANA LETTER ZO' (U+30BE) -- 2.8.0-rc2