diff options
author | Jim Meyering <meyering@redhat.com> | 2010-03-07 20:07:30 +0100 |
---|---|---|
committer | Jim Meyering <meyering@redhat.com> | 2010-03-12 16:25:24 +0100 |
commit | daa5786d8f91f3b7fd9167b28fc040131d8c650d (patch) | |
tree | c1d0171bbc6827a2e7734f330084d93f910f10f7 /tests | |
parent | bafa1341db643225c2421ecca90353e556dedae5 (diff) | |
download | grep-daa5786d8f91f3b7fd9167b28fc040131d8c650d.tar.gz |
tests: add test cases for dfaexec bug
* tests/dfaexec-multibyte: New test.
* tests/Makefile.am (TESTS): Add it.
Reported by Paolo Bonzini in http://bugzilla.redhat.com/544407
and http://bugzilla.redhat.com/544406 .
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Makefile.am | 1 | ||||
-rw-r--r-- | tests/dfaexec-multibyte | 30 |
2 files changed, 31 insertions, 0 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am index 1f54ec7e..06460bc5 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -19,6 +19,7 @@ TESTS = \ bre.sh \ case-fold-char-class \ case-fold-char-type \ + dfaexec-multibyte \ empty.sh \ ere.sh \ file.sh \ diff --git a/tests/dfaexec-multibyte b/tests/dfaexec-multibyte new file mode 100644 index 00000000..47db42bc --- /dev/null +++ b/tests/dfaexec-multibyte @@ -0,0 +1,30 @@ +#!/bin/sh +# This would fail for grep-2.5.3 +: ${srcdir=.} +. "$srcdir/init.sh"; path_prepend_ ../src + +printf 'aa\n' > exp-aa || framework_failure +printf 'ab\n' > exp-ab || framework_failure +printf '1 2 3\n' > exp-123 || framework_failure + +fail=0 + +for LOC in en_US.UTF-8 zh_CN $LOCALE_FR_UTF8; do + LC_ALL=$LOC grep -E '([a]|[b]){2}' < exp-aa > out || fail=1 + compare out exp-aa || fail=1 + + LC_ALL=$LOC grep -E '([b]|[a]){2}' < exp-aa > out || fail=1 + compare out exp-aa || fail=1 + + LC_ALL=$LOC grep -E '([b]|[a]){2}' < exp-ab > out || fail=1 + compare out exp-ab || fail=1 + + LC_ALL=$LOC grep -E '([a]|[b]){2}' < exp-ab > out || fail=1 + compare out exp-ab || fail=1 + + LC_ALL=$LOC grep -E '^([[:digit:]]+[[:space:]]+){2}' < exp-123 > out || fail=1 + compare out exp-123 || fail=1 + +done + +Exit $fail |