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 <santiago@nyu.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Santiago Torres committed Jan 17, 2017 at 18:37 UTC 02c5433e1620e49daa48c7ca0b30b80a39ec08ad
1 file changed +16
t/t7030-verify-tag.sh
+16
@@ -125,4 +125,20 @@ test_expect_success GPG 'verify multiple tags' '
125 test_cmp expect.stderr actual.stderr
126 '
127
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 +
144 test_done