@@ -39,6 +39,10 @@ test_expect_success setup '
3939 echo "a+bc"
4040 echo "abc"
4141 } >ab &&
42+ {
43+ echo d &&
44+ echo 0
45+ } >d0 &&
4246 echo vvv >v &&
4347 echo ww w >w &&
4448 echo x x xx x >x &&
@@ -1105,36 +1109,36 @@ test_expect_success 'grep pattern with grep.patternType=fixed, =basic, =extended
11051109'
11061110
11071111test_expect_success ' grep -G -F -P -E pattern' '
1108- >empty &&
1109- test_must_fail git grep -G -F -P -E "a\x{2b}b\x{2a}c" ab >actual &&
1110- test_cmp empty actual
1112+ echo "d0:d" >expected &&
1113+ git grep -G -F -P -E "[\d]" d0 >actual &&
1114+ test_cmp expected actual
11111115'
11121116
11131117test_expect_success ' grep pattern with grep.patternType=fixed, =basic, =perl, =extended' '
1114- >empty &&
1115- test_must_fail git \
1118+ echo "d0:d" >expected &&
1119+ git \
11161120 -c grep.patterntype=fixed \
11171121 -c grep.patterntype=basic \
11181122 -c grep.patterntype=perl \
11191123 -c grep.patterntype=extended \
1120- grep "a\x{2b}b\x{2a}c" ab >actual &&
1121- test_cmp empty actual
1124+ grep "[\d]" d0 >actual &&
1125+ test_cmp expected actual
11221126'
11231127
11241128test_expect_success LIBPCRE ' grep -G -F -E -P pattern' '
1125- echo "ab:a+b*c " >expected &&
1126- git grep -G -F -E -P "a\x{2b}b\x{2a}c" ab >actual &&
1129+ echo "d0:0 " >expected &&
1130+ git grep -G -F -E -P "[\d]" d0 >actual &&
11271131 test_cmp expected actual
11281132'
11291133
11301134test_expect_success LIBPCRE ' grep pattern with grep.patternType=fixed, =basic, =extended, =perl' '
1131- echo "ab:a+b*c " >expected &&
1135+ echo "d0:0 " >expected &&
11321136 git \
11331137 -c grep.patterntype=fixed \
11341138 -c grep.patterntype=basic \
11351139 -c grep.patterntype=extended \
11361140 -c grep.patterntype=perl \
1137- grep "a\x{2b}b\x{2a}c" ab >actual &&
1141+ grep "[\d]" d0 >actual &&
11381142 test_cmp expected actual
11391143'
11401144
0 commit comments