You've already forked json-iterator
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:
14
jsoniter_interface_test.go
Normal file
14
jsoniter_interface_test.go
Normal 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)
|
||||
}
|
Reference in New Issue
Block a user