[PATCH 2/4] rev-parse test: use test_must_fail, not "if <command>; then false; fi"

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

 



From: Felipe Contreras <felipe.contreras@xxxxxxxxx>

This way, if rev-parse segfaults then the test will fail instead
of treating it the same way as a controlled failure.

Signed-off-by: Felipe Contreras <felipe.contreras@xxxxxxxxx>
Signed-off-by: Jonathan Nieder <jrnieder@xxxxxxxxx>
---
 t/t6101-rev-parse-parents.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/t/t6101-rev-parse-parents.sh b/t/t6101-rev-parse-parents.sh
index c47b869..416067c 100755
--- a/t/t6101-rev-parse-parents.sh
+++ b/t/t6101-rev-parse-parents.sh
@@ -26,7 +26,7 @@ test_expect_success 'start^0' '
 '
 
 test_expect_success 'start^1 not valid' '
-	if git rev-parse --verify start^1; then false; else :; fi
+	test_must_fail git rev-parse --verify start^1
 '
 
 test_expect_success 'second^1 = second^' '
@@ -50,7 +50,7 @@ test_expect_success 'final^1^2 != final^1^1' '
 '
 
 test_expect_success 'final^1^3 not valid' '
-	if git rev-parse --verify final^1^3; then false; else :; fi
+	test_must_fail git rev-parse --verify final^1^3
 '
 
 test_expect_success '--verify start2^1' '
-- 
1.8.4

--
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]