1
0
mirror of https://github.com/json-iterator/go.git synced 2025-06-12 22:47:42 +02:00

consolidate more tests

This commit is contained in:
Tao Wen
2018-02-14 10:13:34 +08:00
parent a8708bca85
commit 477be43d00
15 changed files with 329 additions and 913 deletions

View File

@ -49,6 +49,14 @@ func init() {
Field2 json.RawMessage
})(nil),
input: `{"field1": "hello", "field2":[1,2,3]}`,
}, unmarshalCase{
ptr: (*struct {
a int
b <-chan int
C int
d *time.Timer
})(nil),
input: `{"a": 444, "b":"bad", "C":256, "d":{"not":"a timer"}}`,
})
marshalCases = append(marshalCases,
struct {
@ -135,6 +143,17 @@ func init() {
Field1 *string
Field2 *string
}{Field2: pString("world")},
struct {
a int
b <-chan int
C int
d *time.Timer
}{
a: 42,
b: make(<-chan int, 10),
C: 21,
d: time.NewTimer(10 * time.Second),
},
)
}