Skip to content

Commit 02c5433

Browse files
SantiagoTorresgitster
authored andcommitted
t/t7030-verify-tag: Add --format specifier tests
Verify-tag now provides --format specifiers to inspect and ensure the contents of the tag are proper. We add two tests to ensure this functionality works as expected: the return value should indicate if verification passed, and the format specifiers must be respected. Signed-off-by: Santiago Torres <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 07d347c commit 02c5433

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

t/t7030-verify-tag.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,4 +125,20 @@ test_expect_success GPG 'verify multiple tags' '
125125
test_cmp expect.stderr actual.stderr
126126
'
127127

128+
test_expect_success 'verifying tag with --format' '
129+
cat >expect <<-\EOF
130+
tagname : fourth-signed
131+
EOF &&
132+
git verify-tag --format="tagname : %(tag)" "fourth-signed" >actual &&
133+
test_cmp expect actual
134+
'
135+
136+
test_expect_success 'verifying a forged tag with --format fail and format accordingly' '
137+
cat >expect <<-\EOF
138+
tagname : 7th forged-signed
139+
EOF &&
140+
test_must_fail git verify-tag --format="tagname : %(tag)" $(cat forged1.tag) >actual-forged &&
141+
test_cmp expect actual-forged
142+
'
143+
128144
test_done

0 commit comments

Comments
 (0)