You've already forked json-iterator
mirror of
https://github.com/json-iterator/go.git
synced 2025-06-24 23:16:47 +02:00
object cannot covert to int/float in php, so change covert result to zero
This commit is contained in:
@ -1,8 +1,9 @@
|
||||
package jsoniter
|
||||
|
||||
import (
|
||||
"github.com/json-iterator/go/require"
|
||||
"testing"
|
||||
|
||||
"github.com/json-iterator/go/require"
|
||||
)
|
||||
|
||||
func Test_read_object_as_any(t *testing.T) {
|
||||
@ -18,7 +19,7 @@ func Test_read_object_as_any(t *testing.T) {
|
||||
should.Equal(2, len(any.Keys()))
|
||||
should.Equal(2, any.Size())
|
||||
should.True(any.ToBool())
|
||||
should.Equal(1, any.ToInt())
|
||||
should.Equal(0, any.ToInt())
|
||||
should.Equal(Object, any.ValueType())
|
||||
should.Nil(any.LastError())
|
||||
should.Equal("b", any.GetObject()["a"].ToString())
|
||||
|
Reference in New Issue
Block a user