|
@@ -90,6 +90,16 @@ func Test_array_lazy_any_get(t *testing.T) {
|
|
|
should.Equal("[1,[2,3],4]", any.ToString())
|
|
should.Equal("[1,[2,3],4]", any.ToString())
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+func Test_array_lazy_any_get_invalid(t *testing.T) {
|
|
|
|
|
+ should := require.New(t)
|
|
|
|
|
+ any, err := UnmarshalAnyFromString("[]")
|
|
|
|
|
+ should.Nil(err)
|
|
|
|
|
+ should.Equal(Invalid, any.Get(1,1).ValueType())
|
|
|
|
|
+ should.NotNil(any.Get(1,1).LastError())
|
|
|
|
|
+ should.Equal(Invalid, any.Get("1").ValueType())
|
|
|
|
|
+ should.NotNil(any.Get("1").LastError())
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
func Test_array_lazy_any_set(t *testing.T) {
|
|
func Test_array_lazy_any_set(t *testing.T) {
|
|
|
should := require.New(t)
|
|
should := require.New(t)
|
|
|
any, err := UnmarshalAnyFromString("[1,[2,3],4]")
|
|
any, err := UnmarshalAnyFromString("[1,[2,3],4]")
|