mirror of
https://github.com/FiloSottile/age.git
synced 2026-01-04 03:13:57 +00:00
tests: add expected no match and minor additions
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user