You've already forked json-iterator
mirror of
https://github.com/json-iterator/go.git
synced 2025-06-15 22:50:24 +02:00
consolidate more tests
This commit is contained in:
@ -1,8 +1,14 @@
|
||||
package test
|
||||
|
||||
import "math/big"
|
||||
import (
|
||||
"math/big"
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
func init() {
|
||||
var pRawMessage = func(val json.RawMessage) *json.RawMessage {
|
||||
return &val
|
||||
}
|
||||
nilMap := map[string]string(nil)
|
||||
marshalCases = append(marshalCases,
|
||||
map[string]interface{}{"abc": 1},
|
||||
@ -20,6 +26,7 @@ func init() {
|
||||
},
|
||||
nilMap,
|
||||
&nilMap,
|
||||
map[string]*json.RawMessage{"hello":pRawMessage(json.RawMessage("[]"))},
|
||||
)
|
||||
unmarshalCases = append(unmarshalCases, unmarshalCase{
|
||||
ptr: (*map[string]string)(nil),
|
||||
@ -27,6 +34,9 @@ func init() {
|
||||
}, unmarshalCase{
|
||||
ptr: (*map[string]string)(nil),
|
||||
input: `null`,
|
||||
}, unmarshalCase{
|
||||
ptr: (*map[string]*json.RawMessage)(nil),
|
||||
input: "{\"test\":[{\"key\":\"value\"}]}",
|
||||
})
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user