VirtualBox

source: kBuild/vendor/grep/2.12/tests/unibyte-bracket-expr

Last change on this file was 2595, checked in by bird, 13 years ago

gnu grep version 2.12 (grep-2.12.tar.xz, md5sum=8d2f0346d08b13c18afb81f0e8aa1e2f)

File size: 1.3 KB
Line 
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
24require_ru_RU_koi8_r
25LC_ALL=ru_RU.KOI8-R
26export LC_ALL
27
28fail=0
29
30for 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
38done
39
40Exit $fail
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette