Browse Source

Test grep --and/--or/--not

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
Thomas Rast 16 years ago committed by Junio C Hamano
parent
commit
0f7050469b
  1. 30
      t/t7002-grep.sh

30
t/t7002-grep.sh

@ -125,6 +125,36 @@ do @@ -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 &&

Loading…
Cancel
Save