[PATCH 1/2] t6030: add a bit more tests to git-bisect

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Verify that git-bisect does not start before getting one bad and
one good commit.

Signed-off-by: Junio C Hamano <junkio@xxxxxxx>
---
 t/t6030-bisect-run.sh |   36 ++++++++++++++++++++++++++++++++++++
 1 files changed, 36 insertions(+), 0 deletions(-)

diff --git a/t/t6030-bisect-run.sh b/t/t6030-bisect-run.sh
index 455dc60..1c38f08 100755
--- a/t/t6030-bisect-run.sh
+++ b/t/t6030-bisect-run.sh
@@ -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 \
-- 
1.5.1.53.g77e6f


-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]