t: test http access to "half-auth" repositories
[gitweb.git] / t / t7810-grep.sh
index 75f4716d8cbca0c295668e181a557b186cb37432..24e9b1974d17a02dd1c668e888a67f894e7a1209 100755 (executable)
@@ -47,6 +47,13 @@ test_expect_success setup '
        echo vvv >t/v &&
        mkdir t/a &&
        echo vvv >t/a/v &&
+       {
+               echo "line without leading space1"
+               echo " line with leading space1"
+               echo " line with leading space2"
+               echo " line with leading space3"
+               echo "line without leading space2"
+       } >space &&
        git add . &&
        test_tick &&
        git commit -m initial
@@ -344,6 +351,11 @@ test_expect_success 'grep -f, multiple patterns' '
        test_cmp expected actual
 '
 
+test_expect_success 'grep, multiple patterns' '
+       git grep "$(cat patterns)" >actual &&
+       test_cmp expected actual
+'
+
 cat >expected <<EOF
 file:foo mmap bar
 file:foo_mmap bar
@@ -893,4 +905,20 @@ test_expect_success 'mimic ack-grep --group' '
        test_cmp expected actual
 '
 
+cat >expected <<EOF
+space: line with leading space1
+space: line with leading space2
+space: line with leading space3
+EOF
+
+test_expect_success LIBPCRE 'grep -E "^ "' '
+       git grep -E "^ " space >actual &&
+       test_cmp expected actual
+'
+
+test_expect_success LIBPCRE 'grep -P "^ "' '
+       git grep -P "^ " space >actual &&
+       test_cmp expected actual
+'
+
 test_done