1
0
mirror of https://github.com/json-iterator/go.git synced 2025-06-24 23:16:47 +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

@ -8,15 +8,15 @@ import (
func Test_true(t *testing.T) {
should := require.New(t)
iter := ParseString(DEFAULT_CONFIG, `true`)
iter := ParseString(ConfigOfDefault, `true`)
should.True(iter.ReadBool())
iter = ParseString(DEFAULT_CONFIG, `true`)
iter = ParseString(ConfigOfDefault, `true`)
should.Equal(true, iter.Read())
}
func Test_false(t *testing.T) {
should := require.New(t)
iter := ParseString(DEFAULT_CONFIG, `false`)
iter := ParseString(ConfigOfDefault, `false`)
should.False(iter.ReadBool())
}
@ -30,7 +30,7 @@ func Test_read_bool_as_any(t *testing.T) {
func Test_write_true_false(t *testing.T) {
should := require.New(t)
buf := &bytes.Buffer{}
stream := NewStream(DEFAULT_CONFIG, buf, 4096)
stream := NewStream(ConfigOfDefault, buf, 4096)
stream.WriteTrue()
stream.WriteFalse()
stream.Flush()
@ -41,7 +41,7 @@ func Test_write_true_false(t *testing.T) {
func Test_write_val_bool(t *testing.T) {
should := require.New(t)
buf := &bytes.Buffer{}
stream := NewStream(DEFAULT_CONFIG, buf, 4096)
stream := NewStream(ConfigOfDefault, buf, 4096)
stream.WriteVal(true)
stream.Flush()
should.Nil(stream.Error)