Skip to content

Commit 5fb58f6

Browse files
rybakgitster
authored andcommitted
t1507: assert output of rev-parse
Tests in t1507-rev-parse-upstream.sh compare files "expect" and "actual" to assert the output of "git rev-parse", "git show", and "git log". However, two of the tests '@{reflog}-parsing does not look beyond colon' and '@{upstream}-parsing does not look beyond colon' don't inspect the contents of the created files. Assert output of "git rev-parse" in tests in t1507-rev-parse-upstream.sh to improve test coverage. Signed-off-by: Andrei Rybak <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0e8e076 commit 5fb58f6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

t/t1507-rev-parse-upstream.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,15 +258,17 @@ test_expect_success '@{reflog}-parsing does not look beyond colon' '
258258
git add @{yesterday} &&
259259
git commit -m "funny reflog file" &&
260260
git hash-object @{yesterday} >expect &&
261-
git rev-parse HEAD:@{yesterday} >actual
261+
git rev-parse HEAD:@{yesterday} >actual &&
262+
test_cmp expect actual
262263
'
263264

264265
test_expect_success '@{upstream}-parsing does not look beyond colon' '
265266
echo content >@{upstream} &&
266267
git add @{upstream} &&
267268
git commit -m "funny upstream file" &&
268269
git hash-object @{upstream} >expect &&
269-
git rev-parse HEAD:@{upstream} >actual
270+
git rev-parse HEAD:@{upstream} >actual &&
271+
test_cmp expect actual
270272
'
271273

272274
test_done

0 commit comments

Comments
 (0)