bkabrda / rpms / grep

Forked from rpms/grep 6 years ago
Clone
7c590e7
--- grep-2.5.1/tests/Makefile.am.jj	2001-03-07 05:11:27.000000000 +0100
7c590e7
+++ grep-2.5.1/tests/Makefile.am	2004-12-31 11:42:41.595492300 +0100
7c590e7
@@ -3,7 +3,8 @@
7c590e7
 AWK=@AWK@
7c590e7
 
7c590e7
 TESTS = warning.sh khadafy.sh spencer1.sh bre.sh ere.sh \
7c590e7
-        status.sh empty.sh options.sh backref.sh file.sh
7c590e7
+        status.sh empty.sh options.sh backref.sh file.sh \
7c590e7
+        fmbtest.sh
7c590e7
 EXTRA_DIST = $(TESTS) \
7c590e7
              khadafy.lines khadafy.regexp \
7c590e7
              spencer1.awk spencer1.tests \
a42439b
--- grep-2.5.1/tests/fmbtest.sh	2004-12-31 13:30:23.942871250 +0100
a42439b
+++ grep-2.5.1/tests/fmbtest.sh	2004-12-31 14:09:13.219463855 +0100
a42439b
@@ -0,0 +1,111 @@
7c590e7
+#!/bin/sh
7c590e7
+
7c590e7
+: ${srcdir=.}
7c590e7
+
7c590e7
+# If cs_CZ.UTF-8 locale doesn't work, skip this test silently
7c590e7
+LC_ALL=cs_CZ.UTF-8 locale -k LC_CTYPE 2>/dev/null | ${GREP} -q charmap.*UTF-8 \
7c590e7
+  || exit 77
7c590e7
+
7c590e7
+failures=0
7c590e7
+
7c590e7
+cat > csinput <
7c590e7
+01 Žluťoučká číše
7c590e7
+ČíŠE 02
7c590e7
+03 Z číší Čiší cosi
7c590e7
+04 Čí
7c590e7
+Še 05
7c590e7
+06 ČČČČČČČíšČÍŠčíš
7c590e7
+07 ČČČ ČČČČíšČÍŠčíšEEEE
7c590e7
+čAs 08
7c590e7
+09Čapka
7c590e7
+10ČaSy se měnÍ
7c590e7
+ČÍšE11
7c590e7
+Čas12
7c590e7
+𝇕ČÍšE𝇓13
7c590e7
+ŽČÍšE𝇓14
7c590e7
+𝇕ČÍšEŽ15
7c590e7
+ŽČÍšEŽ16
7c590e7
+ČÍšE𝇓17
7c590e7
+ČÍšEŽ18
7c590e7
+19𝇕ČÍše
7c590e7
+20ŽČÍše
7c590e7
+EOF
7c590e7
+cat > cspatfile <
7c590e7
+ČÍšE
7c590e7
+Čas
7c590e7
+EOF
7c590e7
+
a42439b
+for mode in F G E; do
a42439b
+
a42439b
+test1="$(echo `LC_ALL=cs_CZ.UTF-8 ${GREP} -${mode} -f cspatfile csinput \
7c590e7
+	       | LC_ALL=C sed 's/^.*\([0-9][0-9]\).*$/\1/'`)"
7c590e7
+if test "$test1" != "11 12 13 14 15 16 17 18"; then
a42439b
+  echo "Test #1 ${mode} failed: $test1"
7c590e7
+  failures=1
7c590e7
+fi
7c590e7
+
a42439b
+test2="$(echo `LC_ALL=cs_CZ.UTF-8 ${GREP} -${mode}i -f cspatfile csinput \
7c590e7
+	       | LC_ALL=C sed 's/^.*\([0-9][0-9]\).*$/\1/'`)"
7c590e7
+if test "$test2" != "01 02 07 08 10 11 12 13 14 15 16 17 18 19 20"; then
a42439b
+  echo "Test #2 ${mode} failed: $test2"
7c590e7
+  failures=1
7c590e7
+fi
7c590e7
+
a42439b
+test3="$(echo `LC_ALL=cs_CZ.UTF-8 ${GREP} -${mode}i -e 'ČÍšE' -e 'Čas' csinput \
7c590e7
+	       | LC_ALL=C sed 's/^.*\([0-9][0-9]\).*$/\1/'`)"
7c590e7
+if test "$test3" != "01 02 07 08 10 11 12 13 14 15 16 17 18 19 20"; then
a42439b
+  echo "Test #3 ${mode} failed: $test3"
7c590e7
+  failures=1
7c590e7
+fi
7c590e7
+
a42439b
+test4="$(echo `LC_ALL=cs_CZ.UTF-8 ${GREP} -${mode}iw -f cspatfile csinput \
7c590e7
+	       | LC_ALL=C sed 's/^.*\([0-9][0-9]\).*$/\1/'`)"
7c590e7
+if test "$test4" != "01 02 08 13 17 19"; then
a42439b
+  echo "Test #4 ${mode} failed: $test4"
7c590e7
+  failures=1
7c590e7
+fi
7c590e7
+
a42439b
+done
a42439b
+
a42439b
+# Test that -F --color=always prefers longer matches.
7c590e7
+test5="`echo 'Cosi tu ČišÍ...' \
7c590e7
+	| LC_ALL=cs_CZ.UTF-8 ${GREP} --color=always -Fi -e 'čiš' -e 'čiší'`"
7c590e7
+if echo "$test5" | LC_ALL=C ${GREP} -q 'Cosi tu .*\[.*mČišÍ.*\[.*m\.\.\.'; then
7c590e7
+  :
7c590e7
+else
a42439b
+  echo "Test #5 F failed: $test5"
a42439b
+  failures=1
a42439b
+fi
a42439b
+
a42439b
+for mode in G E; do
a42439b
+
a42439b
+# Test that -{G,E} --color=always prefers earlier pattern matches.
a42439b
+test6="`echo 'Cosi tu ČišÍ...' \
a42439b
+	| LC_ALL=cs_CZ.UTF-8 ${GREP} --color=always -${mode}i -e 'čiš' -e 'čiší'`"
a42439b
+if echo "$test6" | LC_ALL=C ${GREP} -q 'Cosi tu .*\[.*mČiš.*\[.*mÍ\.\.\.'; then
a42439b
+  :
a42439b
+else
a42439b
+  echo "Test #6 ${mode} failed: $test6"
a42439b
+  failures=1
a42439b
+fi
a42439b
+
a42439b
+# Test that -{G,E} --color=always prefers earlier pattern matches.
a42439b
+test7="`echo 'Cosi tu ČišÍ...' \
a42439b
+	| LC_ALL=cs_CZ.UTF-8 ${GREP} --color=always -${mode}i -e 'čiší' -e 'čiš'`"
a42439b
+if echo "$test7" | LC_ALL=C ${GREP} -q 'Cosi tu .*\[.*mČišÍ.*\[.*m\.\.\.'; then
a42439b
+  :
a42439b
+else
a42439b
+  echo "Test #7 ${mode} failed: $test7"
7c590e7
+  failures=1
7c590e7
+fi
7c590e7
+
a42439b
+test8="$(echo `LC_ALL=cs_CZ.UTF-8 ${GREP} -${mode}i -e 'Č.šE' -e 'Č[a-f]s' csinput \
a42439b
+	       | LC_ALL=C sed 's/^.*\([0-9][0-9]\).*$/\1/'`)"
a42439b
+if test "$test8" != "01 02 07 08 10 11 12 13 14 15 16 17 18 19 20"; then
a42439b
+  echo "Test #8 ${mode} failed: $test8"
a42439b
+  failures=1
a42439b
+fi
a42439b
+
a42439b
+done
a42439b
+
7c590e7
+exit $failures
7c590e7
--- grep-2.5.1/tests/Makefile.in.jj	2004-12-31 11:42:53.000000000 +0100
7c590e7
+++ grep-2.5.1/tests/Makefile.in	2004-12-31 11:43:36.871514505 +0100
7c590e7
@@ -97,7 +97,8 @@ install_sh = @install_sh@
7c590e7
 AWK = @AWK@
7c590e7
 
7c590e7
 TESTS = warning.sh khadafy.sh spencer1.sh bre.sh ere.sh \
7c590e7
-        status.sh empty.sh options.sh backref.sh file.sh
7c590e7
+        status.sh empty.sh options.sh backref.sh file.sh \
7c590e7
+	fmbtest.sh
7c590e7
 
7c590e7
 EXTRA_DIST = $(TESTS) \
7c590e7
              khadafy.lines khadafy.regexp \