MCPcopy
hub / github.com/pquerna/ffjson / testType

Function testType

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

Source from the content-addressed store, hash-verified

257 return newIndirect.Interface()
258}
259func testType(t *testing.T, base interface{}, ff interface{}) {
260 require.Implements(t, (*json.Marshaler)(nil), ff)
261 require.Implements(t, (*json.Unmarshaler)(nil), ff)
262 require.Implements(t, (*marshalerFaster)(nil), ff)
263 require.Implements(t, (*unmarshalFaster)(nil), ff)
264
265 if _, ok := base.(unmarshalFaster); ok {
266 require.FailNow(t, "base should not have a UnmarshalJSONFFLexer")
267 }
268
269 if _, ok := base.(marshalerFaster); ok {
270 require.FailNow(t, "base should not have a MarshalJSONBuf")
271 }
272
273 testSameMarshal(t, base, ff)
274 testCycle(t, base, ff)
275}
276
277func testSameMarshal(t *testing.T, base interface{}, ff interface{}) {
278 bufbase, err := json.MarshalIndent(base, " ", " ")

Callers 15

TestFuzzTSAAtringFunction · 0.85
TestFuzzTSAStringFunction · 0.85
TestStringFunction · 0.85
TestArrayFunction · 0.85
TestArrayPtrFunction · 0.85
TestSliceFunction · 0.85
TestSlicePtrFunction · 0.85
TestSlicePtrNilsFunction · 0.85
TestMapPtrNilsFunction · 0.85
TestSlicePtrStructNilsFunction · 0.85

Calls 2

testSameMarshalFunction · 0.85
testCycleFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…