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

25 lines
439 B
Go
Raw Normal View History

2018-02-13 23:49:40 +08:00
package test
import (
"encoding/json"
)
2018-02-13 23:49:40 +08:00
func init() {
marshalCases = append(marshalCases,
json.RawMessage("{}"),
struct {
Env string `json:"env"`
Extra json.RawMessage `json:"extra,omitempty"`
}{
Env: "jfdk",
},
2018-02-13 23:49:40 +08:00
)
2018-02-14 08:58:59 +08:00
unmarshalCases = append(unmarshalCases, unmarshalCase{
2018-02-24 22:04:41 +08:00
ptr: (*json.RawMessage)(nil),
2018-02-14 08:58:59 +08:00
input: `[1,2,3]`,
}, unmarshalCase{
ptr: (*json.RawMessage)(nil),
input: `1.122e+250`,
2018-02-14 08:58:59 +08:00
})
2018-02-13 23:49:40 +08:00
}