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

Function TestMarshalEncoder

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

Source from the content-addressed store, hash-verified

179}
180
181func TestMarshalEncoder(t *testing.T) {
182 record := newLogFFRecord()
183 out := bytes.Buffer{}
184 enc := ffjson.NewEncoder(&out)
185 err := enc.Encode(record)
186 require.NoError(t, err)
187 require.NotEqual(t, 0, out.Len(), "encoded buffer size should not be 0")
188
189 out.Reset()
190 err = enc.EncodeFast(record)
191 require.NoError(t, err)
192 require.NotEqual(t, 0, out.Len(), "encoded buffer size should not be 0")
193}
194
195func TestMarshalEncoderError(t *testing.T) {
196 out := NopWriter{}

Callers

nothing calls this directly

Calls 5

EncodeMethod · 0.95
LenMethod · 0.95
ResetMethod · 0.95
EncodeFastMethod · 0.95
newLogFFRecordFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…