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