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

test array of interface

This commit is contained in:
Tao Wen
2017-01-09 21:00:01 +08:00
parent 1f0a0e9a2d
commit a57c8c6202
3 changed files with 23 additions and 3 deletions

View File

@ -0,0 +1,14 @@
package jsoniter
import (
"testing"
"github.com/json-iterator/go/require"
)
func Test_write_array_of_interface(t *testing.T) {
should := require.New(t)
array := []interface{}{"hello"}
str, err := MarshalToString(array)
should.Nil(err)
should.Equal(`["hello"]`, str)
}