MCPcopy Create free account
hub / github.com/aws/smithy-go / testDecodeJSONInterface

Function testDecodeJSONInterface

document/json/decoder_test.go:147–162  ·  view source on GitHub ↗
(t *testing.T, tt testCase)

Source from the content-addressed store, hash-verified

145}
146
147func testDecodeJSONInterface(t *testing.T, tt testCase) {
148 t.Helper()
149
150 d := json.NewDecoder(func(options *json.DecoderOptions) {
151 *options = tt.decoderOptions
152 })
153 if err := d.DecodeJSONInterface(MustJSONUnmarshal(tt.json, !tt.disableJSONNumber), tt.actual); (err != nil) != tt.wantErr {
154 t.Errorf("DecodeJSONInterface() error = %v, wantErr %v", err, tt.wantErr)
155 }
156
157 expect := serde.PtrToValue(tt.want)
158 actual := serde.PtrToValue(tt.actual)
159 if !reflect.DeepEqual(expect, actual) {
160 t.Errorf("%v != %v", expect, actual)
161 }
162}
163
164func cmpBigFloat() func(x big.Float, y big.Float) bool {
165 return func(x, y big.Float) bool {

Callers 1

Calls 6

DecodeJSONInterfaceMethod · 0.95
NewDecoderFunction · 0.92
PtrToValueFunction · 0.92
MustJSONUnmarshalFunction · 0.85
HelperMethod · 0.80
ErrorfMethod · 0.80

Tested by

no test coverage detected