X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=t%2Ft7008-grep-binary.sh;h=eb8ca88cce59c234d8ee43cc94421024f6b1e0b5;hb=8f81449e885ab2b9bac09b5b835314d26f107b3f;hp=2320e74b69af81a5ead33b90bc3cc40d1995e9ce;hpb=aca20dd558338446336934a4b18516cfbf7d8393;p=git.git diff --git a/t/t7008-grep-binary.sh b/t/t7008-grep-binary.sh index 2320e74b6..eb8ca88cc 100755 --- a/t/t7008-grep-binary.sh +++ b/t/t7008-grep-binary.sh @@ -27,6 +27,18 @@ test_expect_success 'git grep -I ina a' ' test_cmp expect actual ' +test_expect_success 'git grep -c ina a' ' + echo a:1 >expect && + git grep -c ina a >actual && + test_cmp expect actual +' + +test_expect_success 'git grep -l ina a' ' + echo a >expect && + git grep -l ina a >actual && + test_cmp expect actual +' + test_expect_success 'git grep -L bar a' ' echo a >expect && git grep -L bar a >actual && @@ -39,4 +51,52 @@ test_expect_success 'git grep -q ina a' ' test_cmp expect actual ' +test_expect_success 'git grep -F ile a' ' + git grep -F ile a +' + +test_expect_success 'git grep -Fi iLE a' ' + git grep -Fi iLE a +' + +# This test actually passes on platforms where regexec() supports the +# flag REG_STARTEND. +test_expect_failure 'git grep ile a' ' + git grep ile a +' + +test_expect_failure 'git grep .fi a' ' + git grep .fi a +' + +test_expect_success 'git grep -F yf a' " + printf 'y\000f' >f && + git grep -f f -F a +" + +test_expect_success 'git grep -F yx a' " + printf 'y\000x' >f && + test_must_fail git grep -f f -F a +" + +test_expect_success 'git grep -Fi Yf a' " + printf 'Y\000f' >f && + git grep -f f -Fi a +" + +test_expect_failure 'git grep -Fi Yx a' " + printf 'Y\000x' >f && + test_must_fail git grep -f f -Fi a +" + +test_expect_success 'git grep yf a' " + printf 'y\000f' >f && + git grep -f f a +" + +test_expect_failure 'git grep yx a' " + printf 'y\000x' >f && + test_must_fail git grep -f f a +" + test_done