1
0
mirror of https://github.com/json-iterator/go.git synced 2025-06-21 23:07:33 +02:00

support int/string encode

This commit is contained in:
Tao Wen
2017-01-09 17:47:21 +08:00
parent bdbf8dcd42
commit 5b0609f901
11 changed files with 144 additions and 60 deletions

View File

@ -92,7 +92,17 @@ func Test_write_string(t *testing.T) {
stream.WriteString("hello")
stream.Flush()
should.Nil(stream.Error)
should.Equal("hello", buf.String())
should.Equal(`"hello"`, buf.String())
}
func Test_write_val_string(t *testing.T) {
should := require.New(t)
buf := &bytes.Buffer{}
stream := NewStream(buf, 4096)
stream.WriteVal("hello")
stream.Flush()
should.Nil(stream.Error)
should.Equal(`"hello"`, buf.String())
}
func Benchmark_jsoniter_unicode(b *testing.B) {