|
|
|
@ -116,21 +116,22 @@ func TestToString(t *testing.T) { |
|
|
|
|
{"float64", 6.66, "6.66"}, |
|
|
|
|
{"max float64", math.MaxFloat64, "179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"}, //nolint:lll
|
|
|
|
|
{"float32", float32(6.66), "6.66"}, |
|
|
|
|
{"max float32", math.MaxFloat32, "340282346638528860000000000000000000000"}, |
|
|
|
|
{"int", int(math.MaxInt64), "9223372036854775807"}, |
|
|
|
|
{"max float32", float32(math.MaxFloat32), "340282350000000000000000000000000000000"}, |
|
|
|
|
{"int", math.MaxInt64, "9223372036854775807"}, |
|
|
|
|
{"uint", uint(math.MaxUint64), "18446744073709551615"}, |
|
|
|
|
{"int8", math.MaxInt8, "127"}, |
|
|
|
|
{"uint8", math.MaxUint8, "255"}, |
|
|
|
|
{"int16", math.MaxInt16, "32767"}, |
|
|
|
|
{"uint16", math.MaxUint16, "65535"}, |
|
|
|
|
{"int32", math.MaxInt32, "2147483647"}, |
|
|
|
|
{"uint32", math.MaxUint32, "4294967295"}, |
|
|
|
|
{"int64", math.MaxInt64, "9223372036854775807"}, |
|
|
|
|
{"int8", int8(math.MaxInt8), "127"}, |
|
|
|
|
{"uint8", uint8(math.MaxUint8), "255"}, |
|
|
|
|
{"int16", int16(math.MaxInt16), "32767"}, |
|
|
|
|
{"uint16", uint16(math.MaxUint16), "65535"}, |
|
|
|
|
{"int32", int32(math.MaxInt32), "2147483647"}, |
|
|
|
|
{"uint32", uint32(math.MaxUint32), "4294967295"}, |
|
|
|
|
{"int64", int64(math.MaxInt64), "9223372036854775807"}, |
|
|
|
|
{"uint64", uint64(math.MaxUint64), "18446744073709551615"}, |
|
|
|
|
{"string", "abc", "abc"}, |
|
|
|
|
{"bool", false, "false"}, |
|
|
|
|
{"[]byte", []byte("abc"), "abc"}, |
|
|
|
|
{"struct", struct{ Name string }{}, `{"Name":""}`}, |
|
|
|
|
{"nil", nil, ""}, |
|
|
|
|
} |
|
|
|
|
for _, test := range tests { |
|
|
|
|
t.Run(test.name, func(t *testing.T) { |
|
|
|
|