Skip to content

Commit ef34267

Browse files
committed
Fix int64 value handling in tests for cross-architecture compatibility
Update test cases with overflow errors on 32-bit (i386) architectures. Signed-off-by: Arthur Diniz <[email protected]>
1 parent a842674 commit ef34267

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

yaml_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ func TestMarshal(t *testing.T) {
183183
f32String := strconv.FormatFloat(math.MaxFloat32, 'g', -1, 32)
184184
f64String := strconv.FormatFloat(math.MaxFloat64, 'g', -1, 64)
185185
s := MarshalTest{"a", math.MaxInt64, math.MaxFloat32, math.MaxFloat64}
186-
e := []byte(fmt.Sprintf("A: a\nB: %d\nC: %s\nD: %s\n", math.MaxInt64, f32String, f64String))
186+
e := []byte(fmt.Sprintf("A: a\nB: %d\nC: %s\nD: %s\n", int64(math.MaxInt64), f32String, f64String))
187187

188188
y, err := Marshal(s)
189189
if err != nil {
@@ -411,8 +411,8 @@ func TestUnmarshal(t *testing.T) {
411411
// decoding integers
412412
"decode 2^53 + 1 into int": {
413413
encoded: []byte("9007199254740993"),
414-
decodeInto: new(int),
415-
decoded: 9007199254740993,
414+
decodeInto: new(int64),
415+
decoded: int64(9007199254740993),
416416
},
417417
"decode 2^53 + 1 into interface": {
418418
encoded: []byte("9007199254740993"),

0 commit comments

Comments
 (0)