MCPcopy Index your code
hub / github.com/pquerna/ffjson / testExpectedError

Function testExpectedError

tests/ff_test.go:382–387  ·  view source on GitHub ↗
(t *testing.T, expected error, xval string, ff json.Unmarshaler)

Source from the content-addressed store, hash-verified

380}
381
382func 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
389func setXValue(t *testing.T, thing interface{}) {
390 v := reflect.ValueOf(thing)

Callers 15

TestInvalidBareKeyFunction · 0.85
TestInvalidNoValueFunction · 0.85
TestInvalidTrailingCommaFunction · 0.85
TestInvalidRougeCommaFunction · 0.85
TestInvalidRougeColonFunction · 0.85
TestInvalidMissingColonFunction · 0.85
TestInvalidApostropheFunction · 0.85

Calls 1

UnmarshalJSONMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…