Skip to content

Commit

Permalink
add canUint tests
Browse files Browse the repository at this point in the history
Signed-off-by: qmuntal <qmuntaldiaz@microsoft.com>
  • Loading branch information
qmuntal committed Jul 11, 2022
1 parent 66229c9 commit aea9b6b
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion headers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,33 @@ func TestProtectedHeader_MarshalCBOR(t *testing.T) {
wantErr: true,
},
{
name: "invalid content type value",
name: "content type is string",
h: ProtectedHeader{
HeaderLabelContentType: []byte("foo"),
},
wantErr: true,
},
{
name: "content type is negative int8",
h: ProtectedHeader{
HeaderLabelContentType: int8(-1),
},
wantErr: true,
},
{
name: "content type is negative int16",
h: ProtectedHeader{
HeaderLabelContentType: int16(-1),
},
wantErr: true,
},
{
name: "content type is negative int32",
h: ProtectedHeader{
HeaderLabelContentType: int32(-1),
},
wantErr: true,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down

0 comments on commit aea9b6b

Please sign in to comment.