merge tests: use "test_must_fail" instead of ad-hoc pattern
As in the preceding commit change a similar fragile test pattern introduced in b798671fa93 (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 <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ævar Arnfjörð Bjarmason committed
Mar 7, 2022 at 13:48 UTC
8127a2b1f51658f4e3fad1d70bef9ce7a0d030ed
1 file changed
+6
-16
t/t6407-merge-binary.sh
+6
-16
@@ -43,14 +43,9 @@ test_expect_success resolve '
43
rm -f a* m* &&
44
git reset --hard anchor &&
45
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
49
'
50
51
test_expect_success recursive '
@@ -58,14 +53,9 @@ test_expect_success recursive '
53
rm -f a* m* &&
54
git reset --hard anchor &&
55
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
59
'
60
61
test_done