Skip to content

Commit

Permalink
t6030: add a bit more tests to git-bisect
Browse files Browse the repository at this point in the history
Verify that git-bisect does not start before getting one bad and
one good commit.

Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Junio C Hamano committed Apr 7, 2007
1 parent 6fecf19 commit 4f50671
Showing 1 changed file with 37 additions and 1 deletion.
38 changes: 37 additions & 1 deletion t/t6030-bisect-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# Copyright (c) 2007 Christian Couder
#
test_description='Tests git-bisect run functionality'
test_description='Tests git-bisect functionality'

. ./test-lib.sh

Expand Down Expand Up @@ -37,6 +37,42 @@ test_expect_success \
HASH3=$(git rev-list HEAD | head -2 | tail -1) &&
HASH4=$(git rev-list HEAD | head -1)'

test_expect_success 'bisect does not start with only one bad' '
git bisect reset &&
git bisect start &&
git bisect bad $HASH4 || return 1
if git bisect next
then
echo Oops, should have failed.
false
else
:
fi
'

test_expect_success 'bisect does not start with only one good' '
git bisect reset &&
git bisect start &&
git bisect good $HASH1 || return 1
if git bisect next
then
echo Oops, should have failed.
false
else
:
fi
'

test_expect_success 'bisect start with one bad and good' '
git bisect reset &&
git bisect start &&
git bisect good $HASH1 &&
git bisect bad $HASH4 &&
git bisect next
'

# We want to automatically find the commit that
# introduced "Another" into hello.
test_expect_success \
Expand Down

0 comments on commit 4f50671

Please sign in to comment.