Skip to content

Commit 1e36868

Browse files
Miklos Vajnagitster
authored andcommitted
t7501: always use test_cmp instead of diff
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>
1 parent a14f6ca commit 1e36868

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

t/t7501-commit.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ EOF
141141

142142
test_expect_success \
143143
'validate git rev-list output.' \
144-
'diff current expected'
144+
'test_cmp expected current'
145145

146146
test_expect_success 'partial commit that involves removal (1)' '
147147
@@ -151,7 +151,7 @@ test_expect_success 'partial commit that involves removal (1)' '
151151
git commit -m "Partial: add elif" elif &&
152152
git diff-tree --name-status HEAD^ HEAD >current &&
153153
echo "A elif" >expected &&
154-
diff expected current
154+
test_cmp expected current
155155
156156
'
157157

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

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

@@ -187,7 +187,7 @@ test_expect_success 'amend commit to fix author' '
187187
expected &&
188188
git commit --amend --author="$author" &&
189189
git cat-file -p HEAD > current &&
190-
diff expected current
190+
test_cmp expected current
191191
192192
'
193193

@@ -256,7 +256,7 @@ test_expect_success 'amend commit to fix author' '
256256
expected &&
257257
git commit --amend --author="$author" &&
258258
git cat-file -p HEAD > current &&
259-
diff expected current
259+
test_cmp expected current
260260
261261
'
262262

0 commit comments

Comments
 (0)