Skip to content

Commit

Permalink
Add VC-JWT verify test vector (#133)
Browse files Browse the repository at this point in the history
  • Loading branch information
KendallWeihe authored Apr 14, 2024
1 parent 10ed98d commit bcd3730
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
21 changes: 21 additions & 0 deletions vc/vcjwt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,3 +188,24 @@ func TestVector_Decode(t *testing.T) {
})
}
}

func TestVector_Verify(t *testing.T) {
testVectors, err :=
web5.LoadTestVectors[string, any]("../web5-spec/test-vectors/vc_jwt/verify.json")
assert.NoError(t, err)
fmt.Println("Running test vectors: ", testVectors.Description)

for _, vector := range testVectors.Vectors {
t.Run(vector.Description, func(t *testing.T) {
fmt.Println("Running test vector: ", vector.Description)

_, err := vc.Verify[vc.Claims](vector.Input)

if vector.Errors {
assert.Error(t, err)
} else {
assert.NoError(t, err)
}
})
}
}
2 changes: 1 addition & 1 deletion web5-spec

0 comments on commit bcd3730

Please sign in to comment.