Skip to content

Commit

Permalink
Cast numbers in "uint oob" test error messages to avoid overflows (#514)
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonyfok authored Jun 27, 2024
1 parent 18cc44b commit dd523d1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions encoding/cbor/coerce_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func TestAsInt32(t *testing.T) {
},
"uint oob": {
In: Uint(maxv + 1),
Err: fmt.Sprintf("cbor uint %d exceeds", maxv+1),
Err: fmt.Sprintf("cbor uint %d exceeds", Uint(maxv+1)),
},
"negint oob": {
In: NegInt(maxv + 2),
Expand Down Expand Up @@ -330,7 +330,7 @@ func TestAsFloat64(t *testing.T) {
},
"uint oob": {
In: Uint(maxv + 1),
Err: fmt.Sprintf("cbor uint %d exceeds", maxv+1),
Err: fmt.Sprintf("cbor uint %d exceeds", Uint(maxv+1)),
},
"negint oob": {
In: NegInt(maxv + 2),
Expand Down

0 comments on commit dd523d1

Please sign in to comment.