jsoniter_any_map_test.go 376 B

123456789101112131415
  1. package any_tests
  2. import (
  3. "github.com/stretchr/testify/require"
  4. "testing"
  5. "github.com/json-iterator/go"
  6. )
  7. func Test_wrap_map(t *testing.T) {
  8. should := require.New(t)
  9. any := jsoniter.Wrap(map[string]string{"Field1": "hello"})
  10. should.Equal("hello", any.Get("Field1").ToString())
  11. any = jsoniter.Wrap(map[string]string{"Field1": "hello"})
  12. should.Equal(1, any.Size())
  13. }