| 1 | #!/bin/sh
|
|---|
| 2 | # Exercise a DFA range bug that arises only with a unibyte encoding
|
|---|
| 3 | # for which the wide-char-to-single-byte mapping is nontrivial.
|
|---|
| 4 | # E.g., the regexp, [C] would fail to match C in a unibyte locale like
|
|---|
| 5 | # ru_RU.KOI8-R for any C whose wide-char representation differed from
|
|---|
| 6 | # its single-byte equivalent.
|
|---|
| 7 |
|
|---|
| 8 | # Copyright (C) 2011-2012 Free Software Foundation, Inc.
|
|---|
| 9 |
|
|---|
| 10 | # This program is free software: you can redistribute it and/or modify
|
|---|
| 11 | # it under the terms of the GNU General Public License as published by
|
|---|
| 12 | # the Free Software Foundation, either version 3 of the License, or
|
|---|
| 13 | # (at your option) any later version.
|
|---|
| 14 |
|
|---|
| 15 | # This program is distributed in the hope that it will be useful,
|
|---|
| 16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|---|
| 18 | # GNU General Public License for more details.
|
|---|
| 19 |
|
|---|
| 20 | # You should have received a copy of the GNU General Public License
|
|---|
| 21 | # along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|---|
| 22 |
|
|---|
| 23 | . "${srcdir=.}/init.sh"; path_prepend_ ../src
|
|---|
| 24 | require_ru_RU_koi8_r
|
|---|
| 25 | LC_ALL=ru_RU.KOI8-R
|
|---|
| 26 | export LC_ALL
|
|---|
| 27 |
|
|---|
| 28 | fail=0
|
|---|
| 29 |
|
|---|
| 30 | for i in 8 9 a b c d e f; do
|
|---|
| 31 | for j in 0 1 2 3 4 5 6 7 8 9 a b c d e f; do
|
|---|
| 32 | in=in-$i$j
|
|---|
| 33 | b=$(printf "\\x$i$j")
|
|---|
| 34 | echo "$b" > $in || framework_failure_
|
|---|
| 35 | grep "[$b]" $in > out || fail=1
|
|---|
| 36 | compare out $in || fail=1
|
|---|
| 37 | done
|
|---|
| 38 | done
|
|---|
| 39 |
|
|---|
| 40 | Exit $fail
|
|---|