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

Function TestMarshalEncoderError

tests/ff_test.go:195–206  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

193}
194
195func TestMarshalEncoderError(t *testing.T) {
196 out := NopWriter{}
197 enc := ffjson.NewEncoder(&out)
198 v := GiveError{}
199 err := enc.Encode(v)
200 require.Error(t, err, "excpected error from encoder")
201 err = enc.Encode(newLogFFRecord())
202 require.NoError(t, err, "error did not clear as expected.")
203
204 err = enc.EncodeFast(newLogRecord())
205 require.Error(t, err, "excpected error from encoder on type that isn't fast")
206}
207
208func TestUnmarshalFaster(t *testing.T) {
209 buf := []byte(`{"id": 123213, "OriginID": 22, "meth": "GET"}`)

Callers

nothing calls this directly

Calls 5

EncodeMethod · 0.95
EncodeFastMethod · 0.95
newLogFFRecordFunction · 0.85
newLogRecordFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…