summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPaolo Bonzini <bonzini@gnu.org>2010-03-31 10:17:53 +0200
committerPaolo Bonzini <bonzini@gnu.org>2010-03-31 10:18:08 +0200
commit4571dcbdc0e71b3d1cbd75fa94bdf6c64a92036e (patch)
tree4b5d123fe1c7d78545041c47e81d862402a7d1c9 /tests
parent2c51cf6c4d088f4cabaa815754e1737ad1db052d (diff)
downloadgrep-4571dcbdc0e71b3d1cbd75fa94bdf6c64a92036e.tar.gz
tests: use get-mb-cur-max in char-class-multibyte
* tests/char-class-multibyte: Use get-mb-cur-max to detect UTF-8 support. Rewrite previous locale detection code as a grep test.
Diffstat (limited to 'tests')
-rw-r--r--tests/char-class-multibyte15
1 files changed, 11 insertions, 4 deletions
diff --git a/tests/char-class-multibyte b/tests/char-class-multibyte
index d7ed3992..825e3adb 100644
--- a/tests/char-class-multibyte
+++ b/tests/char-class-multibyte
@@ -1,11 +1,12 @@
#!/bin/sh
# This would segfault for grep-2.6
: ${srcdir=.}
-. "$srcdir/init.sh"; path_prepend_ ../src
+. "$srcdir/init.sh"; path_prepend_ . ../src
-if printf '\xc3\n' | LC_ALL=en_US.UTF-8 grep -q '[é]'; then
- skip_ UTF-8 matching seems not to work
-fi
+case $(get-mb-cur-max en_US.UTF-8) in
+ [3456]) ;;
+ *) skip_ 'UTF-8 locale not found' ;;
+esac
printf 'é\n' > exp1 || framework_failure_
fail=0
@@ -24,4 +25,10 @@ for LOC in en_US.UTF-8 $LOCALE_FR_UTF8; do
compare $out exp2 || fail=1
done
+for LOC in en_US.UTF-8 $LOCALE_FR_UTF8; do
+ out=out3-$LOC
+ printf '\xc3\n' | LC_ALL=$LOC grep '[é]' > $out
+ test $? = 1 || fail=1
+done
+
Exit $fail