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 16:30:55 -0400

Index: grep/tests/foad1.sh
diff -u grep/tests/foad1.sh:1.3 grep/tests/foad1.sh:1.4
--- grep/tests/foad1.sh:1.3     Wed Apr 27 18:30:29 2005
+++ grep/tests/foad1.sh Wed Apr 27 20:30:53 2005
@@ -47,6 +47,21 @@
 grep_test "wordword/" "word/" "\<word" -o
 
 
+# Test "--color" option
+
+CB=""
+CE=""
+
+# "--color" with "-i" should output an exact copy of the matching input text.
+grep_test "WordA/wordb/WORDC/" 
"${CB}Word${CE}A/${CB}word${CE}b/${CB}WORD${CE}C/" "Word" --color=always -i
+grep_test "WordA/wordb/WORDC/" 
"${CB}Word${CE}A/${CB}word${CE}b/${CB}WORD${CE}C/" "word" --color=always -i
+grep_test "WordA/wordb/WORDC/" 
"${CB}Word${CE}A/${CB}word${CE}b/${CB}WORD${CE}C/" "WORD" --color=always -i
+
+# End of a previous match should not match a "start of ..." expression.
+grep_test "word_word/" "${CB}word_${CE}word/" "^word_*" --color=always
+grep_test "wordword/" "${CB}word${CE}word/" "\<word" --color=always
+
+
 # Test combination of "-m" with "-A" and anchors.
 # Based on a report from Pavol Gono.
 grep_test "4/40/"  "4/40/"  "^4$" -m1 -A99




reply via email to

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