summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPaolo Bonzini <bonzini@gnu.org>2011-06-07 12:31:42 +0200
committerPaolo Bonzini <bonzini@gnu.org>2011-06-07 13:15:28 +0200
commitb5cd4788533da574c202219de76f82c5cda9cb20 (patch)
tree2ce64a76643e6141da52a52b277103fe419be2ec /tests
parentde5f7000d12747b4729dd1cfc3b0c06e97b0b932 (diff)
downloadgrep-b5cd4788533da574c202219de76f82c5cda9cb20.tar.gz
tests: exercise latent bug in character ranges
* tests/bogus-wctob: New. * Makefile.am (TESTS): Add it.
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am1
-rw-r--r--tests/bogus-wctob17
2 files changed, 18 insertions, 0 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index f354e4a1..8d51727a 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -38,6 +38,7 @@ TESTS = \
backref \
backref-multibyte-slow \
backref-word \
+ bogus-wctob \
bre \
case-fold-backref \
case-fold-backslash-w \
diff --git a/tests/bogus-wctob b/tests/bogus-wctob
new file mode 100644
index 00000000..6be6c397
--- /dev/null
+++ b/tests/bogus-wctob
@@ -0,0 +1,17 @@
+#!/bin/sh
+# This was latent in grep-2.8 and earlier because we punted interpretation
+# of MBCSETs to glibc. However, it becomes apparent as soon as "[à]" is
+# simplified to "à".
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+
+printf '\340' > in || framework_failure_
+fail=0
+
+LC_ALL=en_US.UTF-8 grep '[à]' in
+case $? in
+ 0) fail=1 ;;
+ 1) ;;
+ 2) framework_failure_ unexpected error from grep ;;
+esac
+
+Exit $fail