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

array any support get all

This commit is contained in:
Tao Wen
2017-01-31 20:10:16 +08:00
parent edb96991a8
commit 498ab96d90
2 changed files with 50 additions and 12 deletions

View File

@ -114,6 +114,16 @@ func Test_array_lazy_any_get_all(t *testing.T) {
should.Equal("[1,2,3]", any.Get('*',0).ToString())
}
func Test_array_wrapper_any_get_all(t *testing.T) {
should := require.New(t)
any := wrapArray([][]int{
[]int{1, 2},
[]int{3, 4},
[]int{5, 6},
})
should.Equal("[1,3,5]", any.Get('*',0).ToString())
}
func Test_array_lazy_any_get_invalid(t *testing.T) {
should := require.New(t)
any, err := UnmarshalAnyFromString("[]")