summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3ddf922)
raw | patch | inline | side by side (parent: 3ddf922)
author | Michał Kiedrowicz <michal.kiedrowicz@gmail.com> | |
Mon, 27 Feb 2012 16:45:49 +0000 (17:45 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 27 Feb 2012 20:21:51 +0000 (12:21 -0800) |
Earlier, fba4f1 (grep -P: Fix matching ^ and $) fixed an ancient bug. Add
some tests to protect the change from future breakages; a slightly broken
version of this was a part of the originally submitted patch.
Signed-off-by: Michał Kiedrowicz <michal.kiedrowicz@gmail.com>
Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
some tests to protect the change from future breakages; a slightly broken
version of this was a part of the originally submitted patch.
Signed-off-by: Michał Kiedrowicz <michal.kiedrowicz@gmail.com>
Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t7810-grep.sh | patch | blob | history |
diff --git a/t/t7810-grep.sh b/t/t7810-grep.sh
index 75f4716d8cbca0c295668e181a557b186cb37432..d9ad633310a19a9ebbc2e5024875278d4631129e 100755 (executable)
--- a/t/t7810-grep.sh
+++ b/t/t7810-grep.sh
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
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