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

move IndentionStep to config

This commit is contained in:
Tao Wen
2017-06-13 17:03:27 +08:00
parent acddcf5bbf
commit 48e9f6ec84
6 changed files with 20 additions and 16 deletions

View File

@ -31,8 +31,9 @@ func Test_writeBytes_should_grow_buffer(t *testing.T) {
func Test_writeIndention_should_grow_buffer(t *testing.T) {
should := require.New(t)
stream := NewStream(DEFAULT_CONFIG, nil, 1)
stream.IndentionStep = 2
newCfg := &Config{IndentionStep: 2}
initConfig(newCfg)
stream := NewStream(newCfg, nil, 1)
stream.WriteVal([]int{1, 2, 3})
should.Equal("[\n 1,\n 2,\n 3\n]", string(stream.Buffer()))
}