summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2010-03-04 22:23:06 +0100
committerJim Meyering <meyering@redhat.com>2010-03-05 17:58:48 +0100
commit198a26fa95aef837589d92b6e35a03e0eb0f53c4 (patch)
treeb79d90abb30bb4b0a2610cf7f61fb8509ae12e1a /tests
parent99e6062ab95c7cd404431b605fd9ad02372f646a (diff)
downloadgrep-198a26fa95aef837589d92b6e35a03e0eb0f53c4.tar.gz
fix a bug in handling of -i and character classes
* dfa.c (parse_bracket_exp_mb): Sync one part of this function from gawk's dfa.c, which was patched by Arnold D. Robbins. * tests/case-fold-char-class: New file. Test for the bug. * tests/Makefile.am (TESTS): Add it. (TESTS_ENVIRONMENT): Propagate LOCALE_FR and LOCALE_FR_UTF8 definitions into tests. * NEWS (Bug fixes): Mention it.
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am59
-rw-r--r--tests/case-fold-char-class14
2 files changed, 45 insertions, 28 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 3f7b2024..a2ab1982 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -14,36 +14,37 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-TESTS = \
- backref.sh \
- bre.sh \
- empty.sh \
- ere.sh \
- file.sh \
- fmbtest.sh \
- foad1.sh \
- help-version \
- khadafy.sh \
- max-count-vs-context \
- options.sh \
- pcre.sh \
- spencer1.sh \
- status.sh \
- warning.sh \
- word-multi-file \
- yesno.sh \
+TESTS = \
+ backref.sh \
+ bre.sh \
+ case-fold-char-class \
+ empty.sh \
+ ere.sh \
+ file.sh \
+ fmbtest.sh \
+ foad1.sh \
+ help-version \
+ khadafy.sh \
+ max-count-vs-context \
+ options.sh \
+ pcre.sh \
+ spencer1.sh \
+ status.sh \
+ warning.sh \
+ word-multi-file \
+ yesno.sh \
fedora.sh
-EXTRA_DIST = \
- $(TESTS) \
- bre.awk \
- bre.tests \
- ere.awk \
- ere.tests \
- init.sh \
- khadafy.lines \
- khadafy.regexp \
- spencer1.awk \
+EXTRA_DIST = \
+ $(TESTS) \
+ bre.awk \
+ bre.tests \
+ ere.awk \
+ ere.tests \
+ init.sh \
+ khadafy.lines \
+ khadafy.regexp \
+ spencer1.awk \
spencer1.tests
CLEANFILES = \
@@ -72,6 +73,8 @@ TESTS_ENVIRONMENT = \
fi; \
}; \
export \
+ LOCALE_FR='$(LOCALE_FR)' \
+ LOCALE_FR_UTF8='$(LOCALE_FR_UTF8)' \
AWK=$(AWK) \
GREP=$(top_builddir)/src/grep \
GREP_OPTIONS='' \
diff --git a/tests/case-fold-char-class b/tests/case-fold-char-class
new file mode 100644
index 00000000..c36b3146
--- /dev/null
+++ b/tests/case-fold-char-class
@@ -0,0 +1,14 @@
+#!/bin/sh
+# This would fail for grep-2.5.3
+: ${srcdir=.}
+. "$srcdir/init.sh"; path_prepend_ ../src
+
+printf 'Y\n' > exp || framework_failure
+fail=0
+
+for LOC in en_US.UTF-8 zh_CN $LOCALE_FR_UTF8; do
+ printf 'X\nY\nZ\n' | LC_ALL=$LOC grep -i '[y]' > out || fail=1
+ compare out exp || fail=1
+done
+
+Exit $fail