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

Function testExpectedX

tests/ff_test.go:360–368  ·  view source on GitHub ↗
(t *testing.T, expected interface{}, base interface{}, ff interface{})

Source from the content-addressed store, hash-verified

358}
359
360func testExpectedX(t *testing.T, expected interface{}, base interface{}, ff interface{}) {
361 buf, err := json.Marshal(base)
362 require.NoError(t, err, "base[%T] failed to Marshal", base)
363
364 err = json.Unmarshal(buf, ff)
365 require.NoError(t, err, "ff[%T] failed to Unmarshal", ff)
366
367 require.Equal(t, expected, getXValue(ff), "json.Unmarshal of base[%T] into ff[%T]", base, ff)
368}
369
370func testExpectedXValBare(t *testing.T, expected interface{}, xval string, ff interface{}) {
371 buf := []byte(`{"X":` + xval + `}`)

Callers

nothing calls this directly

Calls 1

getXValueFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…