Skip to content

Commit

Permalink
t3030 (merge-recursive): use test_expect_code
Browse files Browse the repository at this point in the history
Use test_expect_code in preference to repeatedly checking exit codes
by hand.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Ramkumar Ramachandra authored and Junio C Hamano committed Dec 9, 2011
1 parent 0238038 commit 67b6afe
Showing 1 changed file with 6 additions and 66 deletions.
72 changes: 6 additions & 66 deletions t/t3030-merge-recursive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -285,17 +285,7 @@ test_expect_success 'merge-recursive simple' '
rm -fr [abcd] &&
git checkout -f "$c2" &&
git merge-recursive "$c0" -- "$c2" "$c1"
status=$?
case "$status" in
1)
: happy
;;
*)
echo >&2 "why status $status!!!"
false
;;
esac
test_expect_code 1 git merge-recursive "$c0" -- "$c2" "$c1"
'

test_expect_success 'merge-recursive result' '
Expand Down Expand Up @@ -334,17 +324,7 @@ test_expect_success 'merge-recursive remove conflict' '
rm -fr [abcd] &&
git checkout -f "$c1" &&
git merge-recursive "$c0" -- "$c1" "$c5"
status=$?
case "$status" in
1)
: happy
;;
*)
echo >&2 "why status $status!!!"
false
;;
esac
test_expect_code 1 git merge-recursive "$c0" -- "$c1" "$c5"
'

test_expect_success 'merge-recursive remove conflict' '
Expand Down Expand Up @@ -388,17 +368,7 @@ test_expect_success 'merge-recursive d/f conflict' '
git reset --hard &&
git checkout -f "$c1" &&
git merge-recursive "$c0" -- "$c1" "$c4"
status=$?
case "$status" in
1)
: happy
;;
*)
echo >&2 "why status $status!!!"
false
;;
esac
test_expect_code 1 git merge-recursive "$c0" -- "$c1" "$c4"
'

test_expect_success 'merge-recursive d/f conflict result' '
Expand All @@ -422,17 +392,7 @@ test_expect_success 'merge-recursive d/f conflict the other way' '
git reset --hard &&
git checkout -f "$c4" &&
git merge-recursive "$c0" -- "$c4" "$c1"
status=$?
case "$status" in
1)
: happy
;;
*)
echo >&2 "why status $status!!!"
false
;;
esac
test_expect_code 1 git merge-recursive "$c0" -- "$c4" "$c1"
'

test_expect_success 'merge-recursive d/f conflict result the other way' '
Expand All @@ -456,17 +416,7 @@ test_expect_success 'merge-recursive d/f conflict' '
git reset --hard &&
git checkout -f "$c1" &&
git merge-recursive "$c0" -- "$c1" "$c6"
status=$?
case "$status" in
1)
: happy
;;
*)
echo >&2 "why status $status!!!"
false
;;
esac
test_expect_code 1 git merge-recursive "$c0" -- "$c1" "$c6"
'

test_expect_success 'merge-recursive d/f conflict result' '
Expand All @@ -490,17 +440,7 @@ test_expect_success 'merge-recursive d/f conflict' '
git reset --hard &&
git checkout -f "$c6" &&
git merge-recursive "$c0" -- "$c6" "$c1"
status=$?
case "$status" in
1)
: happy
;;
*)
echo >&2 "why status $status!!!"
false
;;
esac
test_expect_code 1 git merge-recursive "$c0" -- "$c6" "$c1"
'

test_expect_success 'merge-recursive d/f conflict result' '
Expand Down

0 comments on commit 67b6afe

Please sign in to comment.