summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <meyering@fb.com>2014-11-09 10:02:40 -0800
committerJim Meyering <meyering@fb.com>2014-11-09 10:17:18 -0800
commit0690074f62b0e65e00c946cc606745dab008117d (patch)
tree37862b356ca5da7ad75c2777ee759d4b87e4e791
parent0604c6de0186c21724546ece7fd19cf73617f8af (diff)
downloadgrep-0690074f62b0e65e00c946cc606745dab008117d.tar.gz
tests: do not fail when the zh_CN.UTF-8 locale is not installed
* tests/word-multibyte: This test would fail on a system with no zh_CN.UTF-8 locale. Use it only if it is installed.
-rwxr-xr-xtests/word-multibyte10
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/word-multibyte b/tests/word-multibyte
index e50fd4fc..9cbb71f3 100755
--- a/tests/word-multibyte
+++ b/tests/word-multibyte
@@ -7,9 +7,17 @@ require_en_utf8_locale_
e_acute=$(printf '\303\251')
printf "$e_acute\n" > in || framework_failure_
+# Use this locale only if it is installed.
+zh=zh_CN.UTF-8
+path_prepend_ .
+case $(get-mb-cur-max $zh) in
+ [456]) ;;
+ *) zh=;;
+esac
+
fail=0
-for LOC in en_US.UTF-8 zh_CN.UTF-8 $LOCALE_FR_UTF8; do
+for LOC in en_US.UTF-8 $zh $LOCALE_FR_UTF8; do
out=out1-$LOC
LC_ALL=$LOC grep '\w' in >$out || fail=1
compare in $out || fail=1