X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft7810-grep.sh;h=8184c264cf942bcd8e6c2f75b5526ddfdc5a11e9;hb=8fe6177ac640ca36814ad3394d4e86b4ce8e29e3;hp=dbc6cd8a775a43efbd8fdf433958ccd090b6e3ab;hpb=96220d837c4f58a6be447127b727b8a55246d231;p=git.git diff --git a/t/t7810-grep.sh b/t/t7810-grep.sh index dbc6cd8a7..8184c264c 100755 --- a/t/t7810-grep.sh +++ b/t/t7810-grep.sh @@ -59,7 +59,29 @@ do echo ${HC}file:4:foo mmap bar_mmap echo ${HC}file:5:foo_mmap bar mmap baz } >expected && - git grep -n -w -e mmap $H >actual && + git -c grep.linenumber=false grep -n -w -e mmap $H >actual && + test_cmp expected actual + ' + + test_expect_success "grep -w $L" ' + { + echo ${HC}file:1:foo mmap bar + echo ${HC}file:3:foo_mmap bar mmap + echo ${HC}file:4:foo mmap bar_mmap + echo ${HC}file:5:foo_mmap bar mmap baz + } >expected && + git -c grep.linenumber=true grep -w -e mmap $H >actual && + test_cmp expected actual + ' + + test_expect_success "grep -w $L" ' + { + echo ${HC}file:foo mmap bar + echo ${HC}file:foo_mmap bar mmap + echo ${HC}file:foo mmap bar_mmap + echo ${HC}file:foo_mmap bar mmap baz + } >expected && + git -c grep.linenumber=true grep --no-line-number -w -e mmap $H >actual && test_cmp expected actual '