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

#53 support escapeHtml

This commit is contained in:
Tao Wen
2017-06-15 23:54:43 +08:00
parent d867c8ba5c
commit 5f22e50c89
30 changed files with 590 additions and 249 deletions

View File

@ -9,7 +9,7 @@ import (
func Test_read_map(t *testing.T) {
should := require.New(t)
iter := ParseString(DEFAULT_CONFIG, `{"hello": "world"}`)
iter := ParseString(ConfigOfDefault, `{"hello": "world"}`)
m := map[string]string{"1": "2"}
iter.ReadVal(&m)
copy(iter.buf, []byte{0, 0, 0, 0, 0, 0})
@ -18,11 +18,11 @@ func Test_read_map(t *testing.T) {
func Test_read_map_of_interface(t *testing.T) {
should := require.New(t)
iter := ParseString(DEFAULT_CONFIG, `{"hello": "world"}`)
iter := ParseString(ConfigOfDefault, `{"hello": "world"}`)
m := map[string]interface{}{"1": "2"}
iter.ReadVal(&m)
should.Equal(map[string]interface{}{"1": "2", "hello": "world"}, m)
iter = ParseString(DEFAULT_CONFIG, `{"hello": "world"}`)
iter = ParseString(ConfigOfDefault, `{"hello": "world"}`)
should.Equal(map[string]interface{}{"hello": "world"}, iter.Read())
}