summaryrefslogtreecommitdiff
path: root/t/t4202-log.sh
diff options
context:
space:
mode:
authorLibravatar Ævar Arnfjörð Bjarmason <avarab@gmail.com>2017-05-20 21:42:09 +0000
committerLibravatar Junio C Hamano <gitster@pobox.com>2017-05-21 08:25:37 +0900
commit9001c1920c9b812efc671bdc0c313d0a3418d8ee (patch)
tree4e627b666edb0746dc08168d6210db6b2a0eb0b8 /t/t4202-log.sh
parentlog: make --regexp-ignore-case work with --perl-regexp (diff)
downloadtgif-9001c1920c9b812efc671bdc0c313d0a3418d8ee.tar.xz
grep: add a test asserting that --perl-regexp dies when !PCRE
Add a test asserting that when --perl-regexp (and -P for grep) is given to git-grep & git-log that we die with an error. In developing the PCRE v2 series I introduced a regression where -P would (through control-flow fall-through) become synonymous with basic POSIX matching. I.e. 'git grep -P '[\d]' would match "d" instead of digits. The entire test suite would still pass with this serious regression, since everything that tested for --perl-regexp would be guarded by the PCRE prerequisite, fix that blind-spot by adding tests under !PCRE asserting that git must die when given --perl-regexp or -P. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4202-log.sh')
-rwxr-xr-xt/t4202-log.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/t/t4202-log.sh b/t/t4202-log.sh
index 547f4c19a7..dbed3efeee 100755
--- a/t/t4202-log.sh
+++ b/t/t4202-log.sh
@@ -418,7 +418,9 @@ test_expect_success 'log with various grep.patternType configurations & command-
git log --pretty=tformat:%s --perl-regexp \
--grep="[\d]\|" >actual.perl.long-arg &&
test_cmp expect.perl actual.perl.long-arg
-
+ else
+ test_must_fail git log --perl-regexp \
+ --grep="[\d]\|"
fi &&
test_cmp expect.fixed actual.fixed.long-arg &&
test_cmp expect.basic actual.basic.long-arg &&