From: Michał Kiedrowicz Date: Mon, 27 Feb 2012 16:45:49 +0000 (+0100) Subject: grep -P: add tests for matching ^ and $ X-Git-Tag: v1.7.10-rc0~38 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=d29d787cd6c0e70891596c61533c1f811425d2d6;p=git.git grep -P: add tests for matching ^ and $ 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 Signed-off-by: Zbigniew Jędrzejewski-Szmek Signed-off-by: Junio C Hamano --- diff --git a/t/t7810-grep.sh b/t/t7810-grep.sh index 75f4716d8..d9ad63331 100755 --- a/t/t7810-grep.sh +++ b/t/t7810-grep.sh @@ -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 @@ -893,4 +900,20 @@ test_expect_success 'mimic ack-grep --group' ' test_cmp expected actual ' +cat >expected <actual && + test_cmp expected actual +' + +test_expect_success LIBPCRE 'grep -P "^ "' ' + git grep -P "^ " space >actual && + test_cmp expected actual +' + test_done