[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/4] tests: exercise latent bug in character ranges
From: |
Paolo Bonzini |
Subject: |
[PATCH 1/4] tests: exercise latent bug in character ranges |
Date: |
Tue, 7 Jun 2011 13:03:37 +0200 |
* tests/bogus-wctob: New.
* Makefile.am (TESTS): Add it.
---
tests/Makefile.am | 1 +
tests/bogus-wctob | 17 +++++++++++++++++
2 files changed, 18 insertions(+), 0 deletions(-)
create mode 100644 tests/bogus-wctob
diff --git a/tests/Makefile.am b/tests/Makefile.am
index f354e4a..22bad3e 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -39,6 +39,7 @@ TESTS = \
backref-multibyte-slow \
backref-word \
bre \
+ bogus-wctob \
case-fold-backref \
case-fold-backslash-w \
case-fold-char-class \
diff --git a/tests/bogus-wctob b/tests/bogus-wctob
new file mode 100644
index 0000000..0237062
--- /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 "[à]" 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
--
1.7.4.4