[PATCH 2/7] modernize t9300: use test_must_fail

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

 



One test case open-codes a test for an expected failure. Replace it by
test_must_fail.

Signed-off-by: Johannes Sixt <j6t@xxxxxxxx>
---
 t/t9300-fast-import.sh | 17 +++--------------
 1 file changed, 3 insertions(+), 14 deletions(-)

diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh
index 566f7bd..e9c7602 100755
--- a/t/t9300-fast-import.sh
+++ b/t/t9300-fast-import.sh
@@ -630,20 +630,9 @@ from refs/heads/branch
 
 INPUT_END
 test_expect_success 'F: non-fast-forward update skips' '
-	if git fast-import <input
-	then
-		echo BAD gfi did not fail
-		return 1
-	else
-		if test $old_branch = `git rev-parse --verify branch^0`
-		then
-			: branch unaffected and failure returned
-			return 0
-		else
-			echo BAD gfi changed branch $old_branch
-			return 1
-		fi
-	fi
+	test_must_fail git fast-import <input &&
+	# branch must remain unaffected
+	test $old_branch = `git rev-parse --verify branch^0`
 '
 
 test_expect_success 'F: verify pack' '
-- 
2.6.2.337.ga235d84

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