Code

grep doc: add --break / --heading / -W to synopsis
[git.git] / t / t7810-grep.sh
index 7ba5b16f99443c0dc5aaff8fbb4ce4ad8874a27c..75f4716d8cbca0c295668e181a557b186cb37432 100755 (executable)
@@ -245,6 +245,28 @@ do
        '
 done
 
+cat >expected <<EOF
+file
+EOF
+test_expect_success 'grep -l -C' '
+       git grep -l -C1 foo >actual &&
+       test_cmp expected actual
+'
+
+cat >expected <<EOF
+file:5
+EOF
+test_expect_success 'grep -l -C' '
+       git grep -c -C1 foo >actual &&
+       test_cmp expected actual
+'
+
+test_expect_success 'grep -L -C' '
+       git ls-files >expected &&
+       git grep -L -C1 nonexistent_string >actual &&
+       test_cmp expected actual
+'
+
 cat >expected <<EOF
 file:foo mmap bar_mmap
 EOF