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 \
7c590e7
--- grep-2.5.1/tests/fmbtest.sh.jj	2004-12-31 11:44:03.584693102 +0100
7c590e7
+++ grep-2.5.1/tests/fmbtest.sh	2004-12-31 13:30:23.942871250 +0100
7c590e7
@@ -0,0 +1,76 @@
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
+
7c590e7
+test1="$(echo `LC_ALL=cs_CZ.UTF-8 ${GREP} -F -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
7c590e7
+  echo "Test #1 failed: $test1"
7c590e7
+  failures=1
7c590e7
+fi
7c590e7
+
7c590e7
+test2="$(echo `LC_ALL=cs_CZ.UTF-8 ${GREP} -Fi -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
7c590e7
+  echo "Test #2 failed: $test2"
7c590e7
+  failures=1
7c590e7
+fi
7c590e7
+
7c590e7
+test3="$(echo `LC_ALL=cs_CZ.UTF-8 ${GREP} -Fi -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
7c590e7
+  echo "Test #3 failed: $test3"
7c590e7
+  failures=1
7c590e7
+fi
7c590e7
+
7c590e7
+test4="$(echo `LC_ALL=cs_CZ.UTF-8 ${GREP} -Fiw -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
7c590e7
+  echo "Test #4 failed: $test4"
7c590e7
+  failures=1
7c590e7
+fi
7c590e7
+
7c590e7
+# Test that --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
7c590e7
+  echo "Test #5 failed: $test5"
7c590e7
+  failures=1
7c590e7
+fi
7c590e7
+
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 \