[PATCH v3 3/7] grep tests: add missing "grep.patternType" config test
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- Nov 29, 2021, 14:50 UTC
- Message-ID
- <patch-v3-3.7-fcad1b1664b-20211129T143956Z-avarab@gmail.com>
- In-Reply-To
- <cover-v3-0.7-00000000000-20211129T143956Z-avarab@gmail.com>
Extend the grep tests to assert that setting "grep.patternType=extended" followed by "grep.patternType=default" will behave as if "--extended-regexp" was provided, and not as "--basic-regexp". In a subsequent commit we'll need to treat "grep.patternType=default" as a special-case, but let's make sure we don't ignore it if "grep.patternType" was set to a non-"default" value before.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> --- t/t7810-grep.sh | 9 +++++++++ 1 file changed, 9 insertions(+)
diff --git a/t/t7810-grep.sh b/t/t7810-grep.sh index 6b6423a07c3..724b1bbbc1c 100755 --- a/t/t7810-grep.sh +++ b/t/t7810-grep.sh @@ -451,6 +451,15 @@ do test_cmp expected actual ' + test_expect_success "grep $L with grep.patternType=extended and grep.patternType=default" ' + echo "${HC}ab:a+bc" >expected && + git \ + -c grep.patternType=extended \ + -c grep.patternType=default \ + grep "a+b*c" $H ab >actual && + test_cmp expected actual + ' + test_expect_success "grep $L with grep.patternType=extended and grep.extendedRegexp=false" ' echo "${HC}ab:abc" >expected && git \
-- 2.34.1.841.gf15fb7e6f34