@matheusbsbs / matheus-bagliano / commits / 4f50671699
Fork 0

t6030: add a bit more tests to git-bisect

Verify that git-bisect does not start before getting one bad and one good commit. Signed-off-by: Junio C Hamano <junkio@cox.net>

Junio C Hamano committed Apr 5, 2007 at 22:52 UTC 4f50671699090089b7967880f9b0291391c8de1a
1 file changed +37 -1
t/t6030-bisect-run.sh
+37 -1
@@ -2,7 +2,7 @@
2 #
3 # Copyright (c) 2007 Christian Couder
4 #
5 -test_description='Tests git-bisect run functionality'
5 +test_description='Tests git-bisect functionality'
6
7 . ./test-lib.sh
8
@@ -37,6 +37,42 @@ test_expect_success \
37 HASH3=$(git rev-list HEAD | head -2 | tail -1) &&
38 HASH4=$(git rev-list HEAD | head -1)'
39
40 +test_expect_success 'bisect does not start with only one bad' '
41 + git bisect reset &&
42 + git bisect start &&
43 + git bisect bad $HASH4 || return 1
44 +
45 + if git bisect next
46 + then
47 + echo Oops, should have failed.
48 + false
49 + else
50 + :
51 + fi
52 +'
53 +
54 +test_expect_success 'bisect does not start with only one good' '
55 + git bisect reset &&
56 + git bisect start &&
57 + git bisect good $HASH1 || return 1
58 +
59 + if git bisect next
60 + then
61 + echo Oops, should have failed.
62 + false
63 + else
64 + :
65 + fi
66 +'
67 +
68 +test_expect_success 'bisect start with one bad and good' '
69 + git bisect reset &&
70 + git bisect start &&
71 + git bisect good $HASH1 &&
72 + git bisect bad $HASH4 &&
73 + git bisect next
74 +'
75 +
76 # We want to automatically find the commit that
77 # introduced "Another" into hello.
78 test_expect_success \