Skip to content

Commit

Permalink
Test grep --and/--or/--not
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Rast <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
  • Loading branch information
trast authored and gitster committed Jun 27, 2009
1 parent 4813926 commit 0f70504
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions t/t7002-grep.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand Down

0 comments on commit 0f70504

Please sign in to comment.