Skip to content

Commit 67b6afe

Browse files
artagnongitster
authored andcommitted
t3030 (merge-recursive): use test_expect_code
Use test_expect_code in preference to repeatedly checking exit codes by hand. Signed-off-by: Ramkumar Ramachandra <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0238038 commit 67b6afe

File tree

1 file changed

+6
-66
lines changed

1 file changed

+6
-66
lines changed

t/t3030-merge-recursive.sh

Lines changed: 6 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -285,17 +285,7 @@ test_expect_success 'merge-recursive simple' '
285285
rm -fr [abcd] &&
286286
git checkout -f "$c2" &&
287287
288-
git merge-recursive "$c0" -- "$c2" "$c1"
289-
status=$?
290-
case "$status" in
291-
1)
292-
: happy
293-
;;
294-
*)
295-
echo >&2 "why status $status!!!"
296-
false
297-
;;
298-
esac
288+
test_expect_code 1 git merge-recursive "$c0" -- "$c2" "$c1"
299289
'
300290

301291
test_expect_success 'merge-recursive result' '
@@ -334,17 +324,7 @@ test_expect_success 'merge-recursive remove conflict' '
334324
rm -fr [abcd] &&
335325
git checkout -f "$c1" &&
336326
337-
git merge-recursive "$c0" -- "$c1" "$c5"
338-
status=$?
339-
case "$status" in
340-
1)
341-
: happy
342-
;;
343-
*)
344-
echo >&2 "why status $status!!!"
345-
false
346-
;;
347-
esac
327+
test_expect_code 1 git merge-recursive "$c0" -- "$c1" "$c5"
348328
'
349329

350330
test_expect_success 'merge-recursive remove conflict' '
@@ -388,17 +368,7 @@ test_expect_success 'merge-recursive d/f conflict' '
388368
git reset --hard &&
389369
git checkout -f "$c1" &&
390370
391-
git merge-recursive "$c0" -- "$c1" "$c4"
392-
status=$?
393-
case "$status" in
394-
1)
395-
: happy
396-
;;
397-
*)
398-
echo >&2 "why status $status!!!"
399-
false
400-
;;
401-
esac
371+
test_expect_code 1 git merge-recursive "$c0" -- "$c1" "$c4"
402372
'
403373

404374
test_expect_success 'merge-recursive d/f conflict result' '
@@ -422,17 +392,7 @@ test_expect_success 'merge-recursive d/f conflict the other way' '
422392
git reset --hard &&
423393
git checkout -f "$c4" &&
424394
425-
git merge-recursive "$c0" -- "$c4" "$c1"
426-
status=$?
427-
case "$status" in
428-
1)
429-
: happy
430-
;;
431-
*)
432-
echo >&2 "why status $status!!!"
433-
false
434-
;;
435-
esac
395+
test_expect_code 1 git merge-recursive "$c0" -- "$c4" "$c1"
436396
'
437397

438398
test_expect_success 'merge-recursive d/f conflict result the other way' '
@@ -456,17 +416,7 @@ test_expect_success 'merge-recursive d/f conflict' '
456416
git reset --hard &&
457417
git checkout -f "$c1" &&
458418
459-
git merge-recursive "$c0" -- "$c1" "$c6"
460-
status=$?
461-
case "$status" in
462-
1)
463-
: happy
464-
;;
465-
*)
466-
echo >&2 "why status $status!!!"
467-
false
468-
;;
469-
esac
419+
test_expect_code 1 git merge-recursive "$c0" -- "$c1" "$c6"
470420
'
471421

472422
test_expect_success 'merge-recursive d/f conflict result' '
@@ -490,17 +440,7 @@ test_expect_success 'merge-recursive d/f conflict' '
490440
git reset --hard &&
491441
git checkout -f "$c6" &&
492442
493-
git merge-recursive "$c0" -- "$c6" "$c1"
494-
status=$?
495-
case "$status" in
496-
1)
497-
: happy
498-
;;
499-
*)
500-
echo >&2 "why status $status!!!"
501-
false
502-
;;
503-
esac
443+
test_expect_code 1 git merge-recursive "$c0" -- "$c6" "$c1"
504444
'
505445

506446
test_expect_success 'merge-recursive d/f conflict result' '

0 commit comments

Comments
 (0)