1
0
mirror of https://github.com/json-iterator/go.git synced 2025-06-24 23:16:47 +02:00

increase coverage

This commit is contained in:
Xargin
2017-07-05 11:40:20 +08:00
parent 1745078ab7
commit 550531a046
7 changed files with 83 additions and 8 deletions

View File

@ -123,6 +123,10 @@ func Test_read_int64_to_any(t *testing.T) {
should.Equal(float64(12345), any.ToFloat64())
should.Equal("12345", any.ToString())
should.Equal(true, any.ToBool())
should.Equal(any.ValueType(), Number)
stream := NewStream(ConfigDefault, nil, 32)
any.WriteTo(stream)
should.Equal("12345", string(stream.Buffer()))
}
func Test_read_int32_to_any(t *testing.T) {
should := require.New(t)
@ -137,6 +141,10 @@ func Test_read_int32_to_any(t *testing.T) {
should.Equal(float64(12345), any.ToFloat64())
should.Equal("12345", any.ToString())
should.Equal(true, any.ToBool())
should.Equal(any.ValueType(), Number)
stream := NewStream(ConfigDefault, nil, 32)
any.WriteTo(stream)
should.Equal("12345", string(stream.Buffer()))
}
func Test_read_uint32_to_any(t *testing.T) {
@ -153,6 +161,9 @@ func Test_read_uint32_to_any(t *testing.T) {
should.Equal("12345", any.ToString())
should.Equal(true, any.ToBool())
should.Equal(any.ValueType(), Number)
stream := NewStream(ConfigDefault, nil, 32)
any.WriteTo(stream)
should.Equal("12345", string(stream.Buffer()))
}
func Test_read_uint64_to_any(t *testing.T) {
@ -169,6 +180,9 @@ func Test_read_uint64_to_any(t *testing.T) {
should.Equal("12345", any.ToString())
should.Equal(true, any.ToBool())
should.Equal(any.ValueType(), Number)
stream := NewStream(ConfigDefault, nil, 32)
any.WriteTo(stream)
should.Equal("12345", string(stream.Buffer()))
}
func Test_int_lazy_any_get(t *testing.T) {