X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft7008-grep-binary.sh;h=eb8ca88cce59c234d8ee43cc94421024f6b1e0b5;hb=2d4fef9b86f41ad929f533e0e52dc1a6048cc2a3;hp=4a12d97922b34e95c1d42319361e8c02f2246a62;hpb=321ffcc0556a94c461ac84667b35494c193804ec;p=git.git diff --git a/t/t7008-grep-binary.sh b/t/t7008-grep-binary.sh index 4a12d9792..eb8ca88cc 100755 --- a/t/t7008-grep-binary.sh +++ b/t/t7008-grep-binary.sh @@ -51,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