(t *testing.T, expected error, xval string, ff json.Unmarshaler)
| 380 | } |
| 381 | |
| 382 | func testExpectedError(t *testing.T, expected error, xval string, ff json.Unmarshaler) { |
| 383 | buf := []byte(`{"X":` + xval + `}`) |
| 384 | err := ff.UnmarshalJSON(buf) |
| 385 | require.Errorf(t, err, "ff[%T] failed to Unmarshal", ff) |
| 386 | require.IsType(t, expected, err) |
| 387 | } |
| 388 | |
| 389 | func setXValue(t *testing.T, thing interface{}) { |
| 390 | v := reflect.ValueOf(thing) |
no test coverage detected
searching dependent graphs…