Thread (1 message) 1 message, 1 author, 2022-03-02

Re: [PATCH 06/15] apply tests: use "test_must_fail" instead of ad-hoc pattern

From: Junio C Hamano <hidden>
Date: 2022-03-02 23:46:47

Ævar Arnfjörð Bjarmason  [off-list ref] writes:
 test_expect_success 'apply should fail gracefully' '
-
-	if git apply --index patch
-	then
-		echo Oops, should not have succeeded
-		false
-	else
-		status=$? &&
-		echo "Status was $status" &&
-		if test -f .git/index.lock
-		then
-			echo Oops, should not have crashed
-			false
-		fi
-	fi
+	test_must_fail git apply --index patch &&
+	test_path_is_missing .git/index.lock
 '
Wow, that is very old fashioned.  Thanks for cleaning up the
leftover mess from the days before test_must_fail was prevalent.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help