summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPaolo Bonzini <bonzini@gnu.org>2010-09-21 17:31:08 +0200
committerPaolo Bonzini <bonzini@gnu.org>2010-09-23 13:54:03 +0200
commite9a541c3955b06ef6ae88a97ae525bf30af91c1d (patch)
tree07569d8f473c704f23711acacda517410a5310c8 /tests
parent99d3c7e1308beb1ce9a3c535ca4b6581ebd653ee (diff)
downloadgrep-e9a541c3955b06ef6ae88a97ae525bf30af91c1d.tar.gz
tests: add testcase for previous fix
* tests/inconsistent-ranges: New. * tests/Makefile.am (TESTS): Add it.
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am1
-rw-r--r--tests/inconsistent-range17
2 files changed, 18 insertions, 0 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index f66543f1..3db1cfbe 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -59,6 +59,7 @@ TESTS = \
help-version \
ignore-mmap \
include-exclude \
+ inconsistent-range \
khadafy \
max-count-vs-context \
options \
diff --git a/tests/inconsistent-range b/tests/inconsistent-range
new file mode 100644
index 00000000..e28acde4
--- /dev/null
+++ b/tests/inconsistent-range
@@ -0,0 +1,17 @@
+#!/bin/sh
+# This would fail for grep-2.6
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+
+printf '00a\n00g\n00z\n00A\n00G\n00Z\n' > in || framework_failure_
+
+fail=0
+
+for LOC in en_US.UTF-8 en_US zh_CN $LOCALE_FR_UTF8 C; do
+ out1=out1-$LOC
+ LC_ALL=$LOC grep -E '(.)\1[A-Z]' in > $out1 || fail=1
+ out2=out2-$LOC
+ LC_ALL=$LOC grep -E '[A-Z]' in > $out2 || fail=1
+ compare $out1 $out2 || fail=1
+done
+
+Exit $fail