diff options
author | Thomas Rast <trast@student.ethz.ch> | 2009-06-27 22:47:44 +0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-06-28 00:15:41 +0400 |
commit | 0f7050469b7ae9a95ab01880ecd5cf22e6e41dd2 (patch) | |
tree | 652248a89ca809856b95d35d78d91e0878b4a84f /t | |
parent | 4813926921862887c23e4160908ec7b8ad9e19dd (diff) |
Test grep --and/--or/--not
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-x | t/t7002-grep.sh | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/t/t7002-grep.sh b/t/t7002-grep.sh index f275af8240..7868af8f18 100755 --- a/t/t7002-grep.sh +++ b/t/t7002-grep.sh @@ -125,6 +125,36 @@ do done +cat >expected <<EOF +file:foo mmap bar_mmap +EOF + +test_expect_success 'grep -e A --and -e B' ' + git grep -e "foo mmap" --and -e bar_mmap >actual && + test_cmp expected actual +' + +cat >expected <<EOF +file:foo_mmap bar mmap +file:foo_mmap bar mmap baz +EOF + + +test_expect_success 'grep ( -e A --or -e B ) --and -e B' ' + git grep \( -e foo_ --or -e baz \) \ + --and -e " mmap" >actual && + test_cmp expected actual +' + +cat >expected <<EOF +file:foo mmap bar +EOF + +test_expect_success 'grep -e A --and --not -e B' ' + git grep -e "foo mmap" --and --not -e bar_mmap >actual && + test_cmp expected actual +' + test_expect_success 'log grep setup' ' echo a >>file && test_tick && |