1
0
mirror of https://github.com/json-iterator/go.git synced 2025-04-20 11:28:49 +02:00
json-iterator/api_tests/config_test.go
2018-02-13 20:58:29 +08:00

17 lines
362 B
Go

package test
import (
"testing"
"github.com/stretchr/testify/require"
"github.com/json-iterator/go"
"encoding/json"
)
func Test_use_number_for_unmarshal(t *testing.T) {
should := require.New(t)
api := jsoniter.Config{UseNumber: true}.Froze()
var obj interface{}
should.Nil(api.UnmarshalFromString("123", &obj))
should.Equal(json.Number("123"), obj)
}