1
0
mirror of https://github.com/json-iterator/go.git synced 2025-04-20 11:28:49 +02:00
json-iterator/value_tests/slice_test.go

28 lines
543 B
Go
Raw Normal View History

2018-02-13 23:49:40 +08:00
package test
func init() {
2018-02-14 08:39:18 +08:00
nilSlice := []string(nil)
marshalCases = append(marshalCases,
[]interface{}{"hello"},
nilSlice,
&nilSlice,
[]byte{1, 2, 3},
2018-02-14 08:39:18 +08:00
)
unmarshalCases = append(unmarshalCases, unmarshalCase{
ptr: (*[]string)(nil),
input: "null",
2018-02-21 07:24:22 +08:00
}, unmarshalCase{
ptr: (*[]string)(nil),
input: "[]",
2018-02-27 12:04:11 +08:00
}, unmarshalCase{
ptr: (*[]byte)(nil),
input: "[1,2,3]",
}, unmarshalCase{
ptr: (*[]byte)(nil),
input: `"aGVsbG8="`,
}, unmarshalCase{
ptr: (*[]byte)(nil),
input: `"c3ViamVjdHM\/X2Q9MQ=="`,
2018-02-14 08:39:18 +08:00
})
}