Skip to content

Commit

Permalink
t7501: always use test_cmp instead of diff
Browse files Browse the repository at this point in the history
This should make the output more readable (by default using diff -u)
when some tests fail.

Also changed the diff order from "current expected" to "expected
current".

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Miklos Vajna authored and Junio C Hamano committed Sep 10, 2008
1 parent a14f6ca commit 1e36868
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions t/t7501-commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ EOF

test_expect_success \
'validate git rev-list output.' \
'diff current expected'
'test_cmp expected current'

test_expect_success 'partial commit that involves removal (1)' '
Expand All @@ -151,7 +151,7 @@ test_expect_success 'partial commit that involves removal (1)' '
git commit -m "Partial: add elif" elif &&
git diff-tree --name-status HEAD^ HEAD >current &&
echo "A elif" >expected &&
diff expected current
test_cmp expected current
'

Expand All @@ -160,7 +160,7 @@ test_expect_success 'partial commit that involves removal (2)' '
git commit -m "Partial: remove file" file &&
git diff-tree --name-status HEAD^ HEAD >current &&
echo "D file" >expected &&
diff expected current
test_cmp expected current
'

Expand All @@ -171,7 +171,7 @@ test_expect_success 'partial commit that involves removal (3)' '
git commit -m "Partial: modify elif" elif &&
git diff-tree --name-status HEAD^ HEAD >current &&
echo "M elif" >expected &&
diff expected current
test_cmp expected current
'

Expand All @@ -187,7 +187,7 @@ test_expect_success 'amend commit to fix author' '
expected &&
git commit --amend --author="$author" &&
git cat-file -p HEAD > current &&
diff expected current
test_cmp expected current
'

Expand Down Expand Up @@ -256,7 +256,7 @@ test_expect_success 'amend commit to fix author' '
expected &&
git commit --amend --author="$author" &&
git cat-file -p HEAD > current &&
diff expected current
test_cmp expected current
'

Expand Down

0 comments on commit 1e36868

Please sign in to comment.