You've already forked json-iterator
mirror of
https://github.com/json-iterator/go.git
synced 2025-06-24 23:16:47 +02:00
extract out any tests
This commit is contained in:
@ -5,7 +5,6 @@ import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"github.com/json-iterator/go/require"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"strconv"
|
||||
"testing"
|
||||
@ -116,23 +115,6 @@ func Test_read_int64_overflow(t *testing.T) {
|
||||
should.NotNil(iter.Error)
|
||||
}
|
||||
|
||||
func Test_read_int64_as_any(t *testing.T) {
|
||||
should := require.New(t)
|
||||
any, err := UnmarshalAnyFromString("1234")
|
||||
should.Nil(err)
|
||||
should.Equal(1234, any.ToInt())
|
||||
should.Equal(io.EOF, any.LastError())
|
||||
should.Equal("1234", any.ToString())
|
||||
should.True(any.ToBool())
|
||||
}
|
||||
|
||||
func Test_int_lazy_any_get(t *testing.T) {
|
||||
should := require.New(t)
|
||||
any, err := UnmarshalAnyFromString("1234")
|
||||
should.Nil(err)
|
||||
should.Equal(Invalid, any.Get(1, "2").ValueType())
|
||||
}
|
||||
|
||||
func Test_wrap_int(t *testing.T) {
|
||||
should := require.New(t)
|
||||
str, err := MarshalToString(WrapInt64(100))
|
||||
|
Reference in New Issue
Block a user