summaryrefslogtreecommitdiff
path: root/tests/high-bit-range
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2011-05-04 13:07:36 +0200
committerJim Meyering <meyering@redhat.com>2011-05-07 15:23:56 +0200
commitd98338ebf842ec9b69631837eee50ebdcd543505 (patch)
treec26e662bb39096cc7071db79e2cdf513c474b955 /tests/high-bit-range
parent8da41c930e03a8635cbd8c89e3e591374c232c89 (diff)
downloadgrep-d98338ebf842ec9b69631837eee50ebdcd543505.tar.gz
tests: exercise bug with 0x80..0xff in [...]
* tests/high-bit-range: New test, inspired by an example in the report by Igor O. Ladygin: http://bugs.debian.org/624387, via Santiago Ruano Rincón's http://savannah.gnu.org/bugs/?33198 * tests/Makefile.am (TESTS): Add it.
Diffstat (limited to 'tests/high-bit-range')
-rw-r--r--tests/high-bit-range28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/high-bit-range b/tests/high-bit-range
new file mode 100644
index 00000000..d150633f
--- /dev/null
+++ b/tests/high-bit-range
@@ -0,0 +1,28 @@
+#!/bin/sh
+# Exercise high-bit-set unibyte-in-[...]-range bug.
+
+# Copyright (C) 2011 Free Software Foundation, Inc.
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+
+fail=0
+
+printf '\x81\n' > in || framework_failure_
+grep "$(printf '[\x81]')" in > out || fail=1
+
+compare out in || fail=1
+
+Exit $fail