test validator file suffix

This commit is contained in:
rhysd 2019-12-19 11:40:54 +09:00
parent a4d48e7891
commit b5118a9ebf
1 changed files with 22 additions and 0 deletions

View File

@ -112,3 +112,25 @@ func TestECDSAValidatorFail(t *testing.T) {
t.Fatal(err)
}
}
func TestValidatorSuffix(t *testing.T) {
for _, test := range []struct {
v Validator
suffix string
}{
{
v: &SHA2Validator{},
suffix: ".sha256",
},
{
v: &ECDSAValidator{},
suffix: ".sig",
},
} {
want := test.suffix
got := test.v.Suffix()
if want != got {
t.Errorf("Wanted %q but got %q", want, got)
}
}
}