]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t1507: assert output of rev-parse
authorAndrei Rybak <rybak.a.v@gmail.com>
Sat, 18 Mar 2023 15:46:46 +0000 (16:46 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 20 Mar 2023 16:11:42 +0000 (09:11 -0700)
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 <rybak.a.v@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t1507-rev-parse-upstream.sh

index c34714ffe3fbe5545da1d05b9a74cfc6113e43dd..4458820168b5fcd42a36841dbd2f54903740eebe 100755 (executable)
@@ -258,7 +258,8 @@ test_expect_success '@{reflog}-parsing does not look beyond colon' '
        git add @{yesterday} &&
        git commit -m "funny reflog file" &&
        git hash-object @{yesterday} >expect &&
-       git rev-parse HEAD:@{yesterday} >actual
+       git rev-parse HEAD:@{yesterday} >actual &&
+       test_cmp expect actual
 '
 
 test_expect_success '@{upstream}-parsing does not look beyond colon' '
@@ -266,7 +267,8 @@ test_expect_success '@{upstream}-parsing does not look beyond colon' '
        git add @{upstream} &&
        git commit -m "funny upstream file" &&
        git hash-object @{upstream} >expect &&
-       git rev-parse HEAD:@{upstream} >actual
+       git rev-parse HEAD:@{upstream} >actual &&
+       test_cmp expect actual
 '
 
 test_done