diff options
author | Todd Zullinger <tmz@pobox.com> | 2019-11-30 03:46:53 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-12-02 09:09:07 +0300 |
commit | e714b898c68c665227930ef3b68cf1acb7d07f3e (patch) | |
tree | e1fc72d488990f665fcd89e96c2aae2dee482ab9 /t | |
parent | c74b3cbb83b382fbedfd728a805c6b6f0e9baaf3 (diff) |
t7812: expect failure for grep -i with invalid UTF-8 data
When the 'grep with invalid UTF-8 data' tests were added/adjusted in
8a5999838e (grep: stess test PCRE v2 on invalid UTF-8 data, 2019-07-26)
and 870eea8166 (grep: do not enter PCRE2_UTF mode on fixed matching,
2019-07-26) they lacked a redirect which caused them to falsely succeed
on most systems. The 'grep -i' test failed on systems where JIT was
disabled as it never reached the portion which was missing the redirect.
A recent patch added the missing redirect and exposed the fact that the
'PCRE v2: grep non-ASCII from invalid UTF-8 data with -i' test fails
regardless of whether JIT is enabled.
Based on the final paragraph in in 870eea8166:
When grepping a non-ASCII fixed string. This is a more general problem
that's hard to fix, but we can at least fix the most common case of
grepping for a fixed string without "-i". I can't think of a reason
for why we'd turn on PCRE2_UTF when matching byte-for-byte like that.
it seems that we don't expect that the case-insensitive grep will
succeed. Adjust the test to reflect that expectation.
Signed-off-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-x | t/t7812-grep-icase-non-ascii.sh | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/t/t7812-grep-icase-non-ascii.sh b/t/t7812-grep-icase-non-ascii.sh index c4528432e5..03dba6685a 100755 --- a/t/t7812-grep-icase-non-ascii.sh +++ b/t/t7812-grep-icase-non-ascii.sh @@ -76,9 +76,12 @@ test_expect_success GETTEXT_LOCALE,LIBPCRE2 'PCRE v2: grep non-ASCII from invali test_expect_success GETTEXT_LOCALE,LIBPCRE2 'PCRE v2: grep non-ASCII from invalid UTF-8 data with -i' ' test_might_fail git grep -hi "Æ" invalid-0x80 >actual && - test_cmp expected actual && + if test -s actual + then + test_cmp expected actual + fi && test_must_fail git grep -hi "(*NO_JIT)Æ" invalid-0x80 >actual && - test_cmp expected actual + ! test_cmp expected actual ' test_done |