Skip to content

Commit 94f07b5

Browse files
rybakgitster
authored andcommitted
t1400: assert output of update-ref
In t1400-update-ref.sh test 'transaction can create and delete' creates files "expect" and "actual", but doesn't compare them. Similarly, test 'transaction cannot restart ongoing transaction' redirects output of "git update-ref" to file "actual", but doesn't check its contents with any assertions. Assert output of "git update-ref" in tests to improve test coverage in t1400-update-ref.sh. Signed-off-by: Andrei Rybak <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 17ae7f7 commit 94f07b5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

t/t1400-update-ref.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1568,6 +1568,7 @@ test_expect_success 'transaction can create and delete' '
15681568
EOF
15691569
git update-ref --stdin <stdin >actual &&
15701570
printf "%s: ok\n" start commit start commit >expect &&
1571+
test_cmp expect actual &&
15711572
test_must_fail git show-ref --verify refs/heads/create-and-delete
15721573
'
15731574

@@ -1595,6 +1596,8 @@ test_expect_success 'transaction cannot restart ongoing transaction' '
15951596
commit
15961597
EOF
15971598
test_must_fail git update-ref --stdin <stdin >actual &&
1599+
printf "%s: ok\n" start >expect &&
1600+
test_cmp expect actual &&
15981601
test_must_fail git show-ref --verify refs/heads/restart
15991602
'
16001603

0 commit comments

Comments
 (0)