diff options
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2017-05-20 21:42:07 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-05-21 08:25:37 +0900 |
commit | 9df46763ef1ee46f2dc1de768b1403552779d011 (patch) | |
tree | 6bdd0293a3244fb42829e8a08e42829960dc8723 /branch.h | |
parent | test-lib: rename the LIBPCRE prerequisite to PCRE (diff) | |
download | tgif-9df46763ef1ee46f2dc1de768b1403552779d011.tar.xz |
log: add exhaustive tests for pattern style options & config
Add exhaustive tests for how the different grep.patternType options &
the corresponding command-line options affect git-log.
Before this change it was possible to patch revision.c so that the
--basic-regexp option was synonymous with --extended-regexp, and
--perl-regexp wasn't recognized at all, and still have 100% of the
test suite pass.
This was because the first test being modified here, added in commit
34a4ae55b2 ("log --grep: use the same helper to set -E/-F options as
"git grep"", 2012-10-03), didn't actually check whether we'd enabled
extended regular expressions as distinct from re-toggling non-fixed
string support.
Fix that by changing the pattern to a pattern that'll only match if
--extended-regexp option is provided, but won't match under the
default --basic-regexp option.
Other potential regressions were possible since there were no tests
for the rest of the combinations of grep.patternType configuration
toggles & corresponding git-log command-line options. Add exhaustive
tests for those.
The patterns being passed to fixed/basic/extended/PCRE are carefully
crafted to return the wrong thing if the grep engine were to pick any
other matching method than the one it's told to use.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'branch.h')
0 files changed, 0 insertions, 0 deletions