diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2014-01-07 17:57:42 +0400 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2014-01-07 17:59:30 +0400 |
commit | cd55f2d9332489432ba2b3093903949c6c2e3e33 (patch) | |
tree | 448769abf7fbdd41af7f74d75ecad91c5714b89e /testsuite | |
parent | 432fbd7a1a71ab5a91a8cfab57fad74fda9389bb (diff) |
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')
-rwxr-xr-x | testsuite/grep.tests | 12 |
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" \ "foop foo\n" \ "" +testing "grep -w ^str doesn't match str not at the beginning" \ + "grep -w ^str input" \ + "" \ + "strstr\n" \ + "" + +testing "grep -w ^ doesn't hang" \ + "grep -w ^ input" \ + "" \ + "anything\n" \ + "" + # testing "test name" "commands" "expected result" "file input" "stdin" # file input will be file called "input" # test can create a file "actual" instead of writing to stdout |