summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2016-11-28 17:11:17 (GMT)
committerPaul Eggert <eggert@cs.ucla.edu>2016-11-28 17:11:40 (GMT)
commit03b491dd84986bf52df10d6dd0395240f1f18ed4 (patch)
treed758c5da94ac0d8858ede434e4f2e0b37b36fde7
parent672b801b44d66c563d725e1e0787aecfabe429fd (diff)
downloadgrep-03b491dd84986bf52df10d6dd0395240f1f18ed4.zip
grep-03b491dd84986bf52df10d6dd0395240f1f18ed4.tar.gz
grep-03b491dd84986bf52df10d6dd0395240f1f18ed4.tar.bz2
tests: revert check for unibyte French range bug
The test wasn't portable, as it assumed that rational ranges were not in effect. Problem reported by Eric Blake (Bug#25048#8). There doesn't seem to be a portable way to do the test, so omit it. * tests/init.cfg, tests/unibyte-bracket-expr: Revert previous change.
-rw-r--r--tests/init.cfg9
-rwxr-xr-xtests/unibyte-bracket-expr58
2 files changed, 31 insertions, 36 deletions
diff --git a/tests/init.cfg b/tests/init.cfg
index 6c7abd2..1677ec5 100644
--- a/tests/init.cfg
+++ b/tests/init.cfg
@@ -74,6 +74,15 @@ require_tr_utf8_locale_()
esac
}
+require_ru_RU_koi8_r()
+{
+ path_prepend_ .
+ case $(get-mb-cur-max ru_RU.KOI8-R) in
+ 1) ;;
+ *) skip_ 'ru_RU.KOI8-R locale not found' ;;
+ esac
+}
+
require_compiled_in_MB_support()
{
require_en_utf8_locale_
diff --git a/tests/unibyte-bracket-expr b/tests/unibyte-bracket-expr
index 85aff1c..68c475c 100755
--- a/tests/unibyte-bracket-expr
+++ b/tests/unibyte-bracket-expr
@@ -1,4 +1,9 @@
#!/bin/sh
+# Exercise a DFA range bug that arises only with a unibyte encoding
+# for which the wide-char-to-single-byte mapping is nontrivial.
+# E.g., the regexp, [C] would fail to match C in a unibyte locale like
+# ru_RU.KOI8-R for any C whose wide-char representation differed from
+# its single-byte equivalent.
# Copyright (C) 2011-2016 Free Software Foundation, Inc.
@@ -16,42 +21,23 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
. "${srcdir=.}/init.sh"; path_prepend_ ../src
-
-# Add "." to PATH for the use of get-mb-cur-max.
-path_prepend_ .
-
-# Exercise a DFA range bug that arises only with a unibyte encoding
-# for which the wide-char-to-single-byte mapping is nontrivial.
-# E.g., the regexp, [C] would fail to match C in a unibyte locale like
-# ru_RU.KOI8-R for any C whose wide-char representation differed from
-# its single-byte equivalent.
-
-case $(get-mb-cur-max ru_RU.KOI8-R) in
- 1)
- fail=0
-
- i=128
- while :; do
- in=in-$i
- octal=$(printf '%03o' $i)
- b=$(printf "\\$octal")
- echo "$b" > $in || framework_failure_
- LC_ALL=ru_RU.KOI8-R grep "[$b]" $in > out || fail=1
- compare out $in || fail=1
-
- test $i = 255 && break
- i=$(expr $i + 1)
- done;;
-esac
-
-# Exercise a DFA range bug where '[d-f]' did not match accented 'e' in a
-# unibyte French locale.
-
-for locale in fr_FR.iso88591 fr_FR.iso885915@euro fr_FR.ISO8859-1; do
- case $(get-mb-cur-max $locale) in
- 1)
- printf '\351\n' | LC_ALL=$locale grep '[d-f]' || fail=1;;
- esac
+require_ru_RU_koi8_r
+LC_ALL=ru_RU.KOI8-R
+export LC_ALL
+
+fail=0
+
+i=128
+while :; do
+ in=in-$i
+ octal=$(printf '%03o' $i)
+ b=$(printf "\\$octal")
+ echo "$b" > $in || framework_failure_
+ grep "[$b]" $in > out || fail=1
+ compare out $in || fail=1
+
+ test $i = 255 && break
+ i=$(expr $i + 1)
done
Exit $fail