1
0
mirror of https://github.com/json-iterator/go.git synced 2025-11-26 22:40:13 +02:00

consolidate more tests

This commit is contained in:
Tao Wen
2018-02-14 08:28:17 +08:00
parent 8fa357ab7b
commit e3bc511e5a
9 changed files with 99 additions and 258 deletions

View File

@@ -13,3 +13,16 @@ func Test_wrap_map(t *testing.T) {
any = jsoniter.Wrap(map[string]string{"Field1": "hello"})
should.Equal(1, any.Size())
}
func Test_map_wrapper_any_get_all(t *testing.T) {
should := require.New(t)
any := jsoniter.Wrap(map[string][]int{"Field1": {1, 2}})
should.Equal(`{"Field1":1}`, any.Get('*', 0).ToString())
should.Contains(any.Keys(), "Field1")
// map write to
stream := jsoniter.NewStream(jsoniter.ConfigDefault, nil, 0)
any.WriteTo(stream)
// TODO cannot pass
//should.Equal(string(stream.buf), "")
}