Skip to content

Commit 1ff543a

Browse files
avargitster
authored andcommitted
apply tests: use "test_must_fail" instead of ad-hoc pattern
Change a fragile test pattern introduced in 6b763c4 (git-apply: do not read past the end of buffer, 2007-09-05). Before this we wouldn't distinguish normal "git apply" failures from segfaults or abort(). I'd previously marked this test as passing under SANITIZE=leak in f54f48f (leak tests: mark some apply tests as passing with SANITIZE=leak, 2021-10-31). Let's remove that annotation as this test will no longer pass. Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 5476bdf commit 1ff543a

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

t/t4123-apply-shrink.sh

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
test_description='apply a patch that is larger than the preimage'
44

5-
6-
TEST_PASSES_SANITIZE_LEAK=true
75
. ./test-lib.sh
86

97
cat >F <<\EOF
@@ -41,20 +39,8 @@ test_expect_success setup '
4139
'
4240

4341
test_expect_success 'apply should fail gracefully' '
44-
45-
if git apply --index patch
46-
then
47-
echo Oops, should not have succeeded
48-
false
49-
else
50-
status=$? &&
51-
echo "Status was $status" &&
52-
if test -f .git/index.lock
53-
then
54-
echo Oops, should not have crashed
55-
false
56-
fi
57-
fi
42+
test_must_fail git apply --index patch &&
43+
test_path_is_missing .git/index.lock
5844
'
5945

6046
test_done

0 commit comments

Comments
 (0)