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

map any support get all

This commit is contained in:
Tao Wen
2017-01-31 23:16:40 +08:00
parent bf459b9a49
commit 1e91dbbf58
3 changed files with 56 additions and 13 deletions

View File

@ -43,6 +43,12 @@ func Test_wrap_map(t *testing.T) {
should.Equal(map[string]string{"Field1":"hello"}, vals)
}
func Test_map_wrapper_any_get_all(t *testing.T) {
should := require.New(t)
any := Wrap(map[string][]int{"Field1": []int{1, 2}})
should.Equal(`{"Field1":1}`, any.Get('*', 0).ToString())
}
func Test_write_val_map(t *testing.T) {
should := require.New(t)
val := map[string]string{"1": "2"}