aboutsummaryrefslogtreecommitdiff
path: root/testsuite/grep.tests
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2014-01-07 14:57:42 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2014-01-07 14:59:30 +0100
commitcd55f2d9332489432ba2b3093903949c6c2e3e33 (patch)
tree448769abf7fbdd41af7f74d75ecad91c5714b89e /testsuite/grep.tests
parent432fbd7a1a71ab5a91a8cfab57fad74fda9389bb (diff)
downloadbusybox-w32-cd55f2d9332489432ba2b3093903949c6c2e3e33.tar.gz
busybox-w32-cd55f2d9332489432ba2b3093903949c6c2e3e33.tar.bz2
busybox-w32-cd55f2d9332489432ba2b3093903949c6c2e3e33.zip
grep: fix two bugs with -w
Unfortunately, with !EXTRA_COMPAT, "grep -w ^str" still erroneously matches "strstr". function old new delta grep_file 1499 1510 +11 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'testsuite/grep.tests')
-rwxr-xr-xtestsuite/grep.tests12
1 files changed, 12 insertions, 0 deletions
diff --git a/testsuite/grep.tests b/testsuite/grep.tests
index 64d99a905..412efffbb 100755
--- a/testsuite/grep.tests
+++ b/testsuite/grep.tests
@@ -147,6 +147,18 @@ testing "grep -w doesn't stop on 1st mismatch" \
147 "foop foo\n" \ 147 "foop foo\n" \
148 "" 148 ""
149 149
150testing "grep -w ^str doesn't match str not at the beginning" \
151 "grep -w ^str input" \
152 "" \
153 "strstr\n" \
154 ""
155
156testing "grep -w ^ doesn't hang" \
157 "grep -w ^ input" \
158 "" \
159 "anything\n" \
160 ""
161
150# testing "test name" "commands" "expected result" "file input" "stdin" 162# testing "test name" "commands" "expected result" "file input" "stdin"
151# file input will be file called "input" 163# file input will be file called "input"
152# test can create a file "actual" instead of writing to stdout 164# test can create a file "actual" instead of writing to stdout