1
0
mirror of https://github.com/json-iterator/go.git synced 2025-06-15 22:50:24 +02:00

#68 number to string

This commit is contained in:
Tao Wen
2017-06-20 15:11:01 +08:00
parent 8f6a840c63
commit 818ae1331a
19 changed files with 387 additions and 325 deletions

View File

@ -0,0 +1,25 @@
package extra
import (
"testing"
"github.com/json-iterator/go"
"github.com/json-iterator/go/require"
)
func init() {
RegisterFuzzyDecoders()
}
func Test_int_to_string(t *testing.T) {
should := require.New(t)
var val string
should.Nil(jsoniter.UnmarshalFromString(`100`, &val))
should.Equal("100", val)
}
func Test_float_to_string(t *testing.T) {
should := require.New(t)
var val string
should.Nil(jsoniter.UnmarshalFromString(`12.0`, &val))
should.Equal("12.0", val)
}