- More -w tests from Jakub Jelinek.

This commit is contained in:
Tim Waugh 2005-01-07 10:34:34 +00:00
parent 1a2dc41f1f
commit a42439b4cd
2 changed files with 49 additions and 13 deletions

View File

@ -10,9 +10,9 @@
EXTRA_DIST = $(TESTS) \ EXTRA_DIST = $(TESTS) \
khadafy.lines khadafy.regexp \ khadafy.lines khadafy.regexp \
spencer1.awk spencer1.tests \ spencer1.awk spencer1.tests \
--- grep-2.5.1/tests/fmbtest.sh.jj 2004-12-31 11:44:03.584693102 +0100 --- grep-2.5.1/tests/fmbtest.sh 2004-12-31 13:30:23.942871250 +0100
+++ grep-2.5.1/tests/fmbtest.sh 2004-12-31 13:30:23.942871250 +0100 +++ grep-2.5.1/tests/fmbtest.sh 2004-12-31 14:09:13.219463855 +0100
@@ -0,0 +1,76 @@ @@ -0,0 +1,111 @@
+#!/bin/sh +#!/bin/sh
+ +
+: ${srcdir=.} +: ${srcdir=.}
@ -50,44 +50,79 @@
+Čas +Čas
+EOF +EOF
+ +
+test1="$(echo `LC_ALL=cs_CZ.UTF-8 ${GREP} -F -f cspatfile csinput \ +for mode in F G E; do
+
+test1="$(echo `LC_ALL=cs_CZ.UTF-8 ${GREP} -${mode} -f cspatfile csinput \
+ | LC_ALL=C sed 's/^.*\([0-9][0-9]\).*$/\1/'`)" + | LC_ALL=C sed 's/^.*\([0-9][0-9]\).*$/\1/'`)"
+if test "$test1" != "11 12 13 14 15 16 17 18"; then +if test "$test1" != "11 12 13 14 15 16 17 18"; then
+ echo "Test #1 failed: $test1" + echo "Test #1 ${mode} failed: $test1"
+ failures=1 + failures=1
+fi +fi
+ +
+test2="$(echo `LC_ALL=cs_CZ.UTF-8 ${GREP} -Fi -f cspatfile csinput \ +test2="$(echo `LC_ALL=cs_CZ.UTF-8 ${GREP} -${mode}i -f cspatfile csinput \
+ | LC_ALL=C sed 's/^.*\([0-9][0-9]\).*$/\1/'`)" + | LC_ALL=C sed 's/^.*\([0-9][0-9]\).*$/\1/'`)"
+if test "$test2" != "01 02 07 08 10 11 12 13 14 15 16 17 18 19 20"; then +if test "$test2" != "01 02 07 08 10 11 12 13 14 15 16 17 18 19 20"; then
+ echo "Test #2 failed: $test2" + echo "Test #2 ${mode} failed: $test2"
+ failures=1 + failures=1
+fi +fi
+ +
+test3="$(echo `LC_ALL=cs_CZ.UTF-8 ${GREP} -Fi -e 'ČÍšE' -e 'Čas' csinput \ +test3="$(echo `LC_ALL=cs_CZ.UTF-8 ${GREP} -${mode}i -e 'ČÍšE' -e 'Čas' csinput \
+ | LC_ALL=C sed 's/^.*\([0-9][0-9]\).*$/\1/'`)" + | LC_ALL=C sed 's/^.*\([0-9][0-9]\).*$/\1/'`)"
+if test "$test3" != "01 02 07 08 10 11 12 13 14 15 16 17 18 19 20"; then +if test "$test3" != "01 02 07 08 10 11 12 13 14 15 16 17 18 19 20"; then
+ echo "Test #3 failed: $test3" + echo "Test #3 ${mode} failed: $test3"
+ failures=1 + failures=1
+fi +fi
+ +
+test4="$(echo `LC_ALL=cs_CZ.UTF-8 ${GREP} -Fiw -f cspatfile csinput \ +test4="$(echo `LC_ALL=cs_CZ.UTF-8 ${GREP} -${mode}iw -f cspatfile csinput \
+ | LC_ALL=C sed 's/^.*\([0-9][0-9]\).*$/\1/'`)" + | LC_ALL=C sed 's/^.*\([0-9][0-9]\).*$/\1/'`)"
+if test "$test4" != "01 02 08 13 17 19"; then +if test "$test4" != "01 02 08 13 17 19"; then
+ echo "Test #4 failed: $test4" + echo "Test #4 ${mode} failed: $test4"
+ failures=1 + failures=1
+fi +fi
+ +
+# Test that --color=always prefers longer matches. +done
+
+# Test that -F --color=always prefers longer matches.
+test5="`echo 'Cosi tu ČišÍ...' \ +test5="`echo 'Cosi tu ČišÍ...' \
+ | LC_ALL=cs_CZ.UTF-8 ${GREP} --color=always -Fi -e 'čiš' -e 'čiší'`" + | LC_ALL=cs_CZ.UTF-8 ${GREP} --color=always -Fi -e 'čiš' -e 'čiší'`"
+if echo "$test5" | LC_ALL=C ${GREP} -q 'Cosi tu .*\[.*mČišÍ.*\[.*m\.\.\.'; then +if echo "$test5" | LC_ALL=C ${GREP} -q 'Cosi tu .*\[.*mČišÍ.*\[.*m\.\.\.'; then
+ : + :
+else +else
+ echo "Test #5 failed: $test5" + echo "Test #5 F failed: $test5"
+ failures=1 + failures=1
+fi +fi
+ +
+for mode in G E; do
+
+# Test that -{G,E} --color=always prefers earlier pattern matches.
+test6="`echo 'Cosi tu ČišÍ...' \
+ | LC_ALL=cs_CZ.UTF-8 ${GREP} --color=always -${mode}i -e 'čiš' -e 'čiší'`"
+if echo "$test6" | LC_ALL=C ${GREP} -q 'Cosi tu .*\[.*mČiš.*\[.*mÍ\.\.\.'; then
+ :
+else
+ echo "Test #6 ${mode} failed: $test6"
+ failures=1
+fi
+
+# Test that -{G,E} --color=always prefers earlier pattern matches.
+test7="`echo 'Cosi tu ČišÍ...' \
+ | LC_ALL=cs_CZ.UTF-8 ${GREP} --color=always -${mode}i -e 'čiší' -e 'čiš'`"
+if echo "$test7" | LC_ALL=C ${GREP} -q 'Cosi tu .*\[.*mČišÍ.*\[.*m\.\.\.'; then
+ :
+else
+ echo "Test #7 ${mode} failed: $test7"
+ failures=1
+fi
+
+test8="$(echo `LC_ALL=cs_CZ.UTF-8 ${GREP} -${mode}i -e 'Č.šE' -e 'Č[a-f]s' csinput \
+ | LC_ALL=C sed 's/^.*\([0-9][0-9]\).*$/\1/'`)"
+if test "$test8" != "01 02 07 08 10 11 12 13 14 15 16 17 18 19 20"; then
+ echo "Test #8 ${mode} failed: $test8"
+ failures=1
+fi
+
+done
+
+exit $failures +exit $failures
--- grep-2.5.1/tests/Makefile.in.jj 2004-12-31 11:42:53.000000000 +0100 --- grep-2.5.1/tests/Makefile.in.jj 2004-12-31 11:42:53.000000000 +0100
+++ grep-2.5.1/tests/Makefile.in 2004-12-31 11:43:36.871514505 +0100 +++ grep-2.5.1/tests/Makefile.in 2004-12-31 11:43:36.871514505 +0100

View File

@ -89,6 +89,7 @@ fi
%changelog %changelog
* Fri Jan 7 2005 Tim Waugh <twaugh@redhat.com> * Fri Jan 7 2005 Tim Waugh <twaugh@redhat.com>
- More -w tests from Jakub Jelinek.
- Rebased on 2.5.1a. - Rebased on 2.5.1a.
* Fri Dec 31 2004 Tim Waugh <twaugh@redhat.com> 2.5.1-45 * Fri Dec 31 2004 Tim Waugh <twaugh@redhat.com> 2.5.1-45