Skip to content

Commit 8127a2b

Browse files
avargitster
authored andcommitted
merge tests: use "test_must_fail" instead of ad-hoc pattern
As in the preceding commit change a similar fragile test pattern introduced in b798671 (merge-recursive: do not rudely die on binary merge, 2007-08-14) to use a "test_must_fail" instead. Before this we wouldn't distinguish normal "git merge" failures from segfaults or abort(). Unlike the preceding commit we didn't end up hiding any SANITIZE=leak failures in this case, but let's correspondingly change these anyway. Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 1ff543a commit 8127a2b

File tree

1 file changed

+6
-16
lines changed

1 file changed

+6
-16
lines changed

t/t6407-merge-binary.sh

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -43,29 +43,19 @@ test_expect_success resolve '
4343
rm -f a* m* &&
4444
git reset --hard anchor &&
4545
46-
if git merge -s resolve main
47-
then
48-
echo Oops, should not have succeeded
49-
false
50-
else
51-
git ls-files -s >current &&
52-
test_cmp expect current
53-
fi
46+
test_must_fail git merge -s resolve main &&
47+
git ls-files -s >current &&
48+
test_cmp expect current
5449
'
5550

5651
test_expect_success recursive '
5752
5853
rm -f a* m* &&
5954
git reset --hard anchor &&
6055
61-
if git merge -s recursive main
62-
then
63-
echo Oops, should not have succeeded
64-
false
65-
else
66-
git ls-files -s >current &&
67-
test_cmp expect current
68-
fi
56+
test_must_fail git merge -s recursive main &&
57+
git ls-files -s >current &&
58+
test_cmp expect current
6959
'
7060

7161
test_done

0 commit comments

Comments
 (0)