grep-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Changes to grep/tests/foad1.sh


From: Julian Foad
Subject: Changes to grep/tests/foad1.sh
Date: Wed, 27 Apr 2005 14:30:39 -0400

Index: grep/tests/foad1.sh
diff -u grep/tests/foad1.sh:1.2 grep/tests/foad1.sh:1.3
--- grep/tests/foad1.sh:1.2     Tue Apr 12 17:43:54 2005
+++ grep/tests/foad1.sh Wed Apr 27 18:30:29 2005
@@ -7,19 +7,18 @@
 VERBOSE=  # empty or "1"
 failures=0
 
-# grep_test INPUT EXPECTED_OUTPUT PATTERN [OPTION...]
-# Run "grep" with the given INPUT, PATTERN and OPTIONs, and check that
+# grep_test INPUT EXPECTED_OUTPUT PATTERN_AND_OPTIONS...
+# Run "grep" with the given INPUT, pattern and options, and check that
 # the output is EXPECTED_OUTPUT.  If not, print a message and set 'failures'.
 # "/" represents a newline within INPUT and EXPECTED_OUTPUT.
 grep_test ()
 {
   INPUT="$1"
   EXPECT="$2"
-  PATTERN="$3"
-  shift 3
-  OUTPUT=`echo -n "$INPUT" | tr "/" "\n" | "$GREP" "$@" "$PATTERN" | tr "\n" 
"/"`
+  shift 2
+  OUTPUT=`echo -n "$INPUT" | tr "/" "\n" | "$GREP" "$@" | tr "\n" "/"`
   if test "$OUTPUT" != "$EXPECT" || test "$VERBOSE" == "1"; then
-    echo "Testing:  $GREP $@ \"$PATTERN\""
+    echo "Testing:  $GREP $@"
     echo "  input:  \"$INPUT\""
     echo "  output: \"$OUTPUT\""
   fi
@@ -61,4 +60,9 @@
 grep_test "4/444/" "4/444/" "4$"  -m1 -A99
 
 
+# Test for "-F -w" bugs.  Thanks to Gordon Lack for these two.
+grep_test "A/CX/B/C/" "A/B/C/" -wF -e A -e B -e C
+grep_test "LIN7C 55327/" "" -wF -e 5327 -e 5532
+
+
 exit $failures




reply via email to

[Prev in Thread] Current Thread [Next in Thread]