Skip to content

Commit 14c14b4

Browse files
sorganovgitster
authored andcommitted
t4013: support test_expect_failure through ':failure' magic
Add support to be able to specify expected failure, through :failure magic, like this: :failure cmd args Signed-off-by: Sergey Organov <sorganov@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent e121b4b commit 14c14b4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

t/t4013-diff-various.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ process_diffs () {
174174
V=$(git version | sed -e 's/^git version //' -e 's/\./\\./g')
175175
while read magic cmd
176176
do
177+
status=success
177178
case "$magic" in
178179
'' | '#'*)
179180
continue ;;
@@ -182,6 +183,10 @@ do
182183
label="$magic-$cmd"
183184
case "$magic" in
184185
noellipses) ;;
186+
failure)
187+
status=failure
188+
magic=
189+
label="$cmd" ;;
185190
*)
186191
BUG "unknown magic $magic" ;;
187192
esac ;;
@@ -194,7 +199,7 @@ do
194199
expect="$TEST_DIRECTORY/t4013/diff.$test"
195200
actual="$pfx-diff.$test"
196201

197-
test_expect_success "git $cmd # magic is ${magic:-(not used)}" '
202+
test_expect_$status "git $cmd # magic is ${magic:-(not used)}" '
198203
{
199204
echo "$ git $cmd"
200205
case "$magic" in

0 commit comments

Comments
 (0)