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

struct encoder

This commit is contained in:
Tao Wen
2017-01-09 19:19:48 +08:00
parent 5b0609f901
commit 552afb3625
8 changed files with 336 additions and 50 deletions

View File

@@ -30,4 +30,15 @@ func Test_write_true_false(t *testing.T) {
stream.Flush()
should.Nil(stream.Error)
should.Equal("truefalse", buf.String())
}
func Test_write_val_bool(t *testing.T) {
should := require.New(t)
buf := &bytes.Buffer{}
stream := NewStream(buf, 4096)
stream.WriteVal(true)
stream.Flush()
should.Nil(stream.Error)
should.Equal("true", buf.String())
}