tests: add expected no match and minor additions

This commit is contained in:
Filippo Valsorda
2022-06-19 00:11:23 +02:00
parent eaa4e03cfe
commit 2088adf268
17 changed files with 63 additions and 15 deletions

View File

@@ -97,6 +97,7 @@ func testVector(t *testing.T, test []byte) {
case "HMAC failure":
case "header failure":
case "payload failure":
case "no match":
default:
t.Fatal("invalid test file: unknown expect value:", value)
}
@@ -135,6 +136,12 @@ func testVector(t *testing.T, test []byte) {
return
}
t.Fatalf("expected %s, got HMAC error", expect)
} else if _, ok := err.(*age.NoIdentityMatchError); ok {
if expect == "no match" {
t.Log(err)
return
}
t.Fatalf("expected %s, got: %v", expect, err)
} else if err != nil {
if expect == "header failure" {
t.Log(err)