MCPcopy
hub / github.com/uber-go/zap / fuzzSafeAppendStringLike

Function fuzzSafeAppendStringLike

zapcore/json_encoder_impl_test.go:719–736  ·  view source on GitHub ↗
(
	t *testing.T,
	want string,
	writeString func(*buffer.Buffer),
)

Source from the content-addressed store, hash-verified

717}
718
719func fuzzSafeAppendStringLike(
720 t *testing.T,
721 want string,
722 writeString func(*buffer.Buffer),
723) {
724 t.Helper()
725
726 buf := bufferpool.Get()
727 defer buf.Free()
728
729 buf.AppendByte('"')
730 writeString(buf)
731 buf.AppendByte('"')
732
733 var got string
734 require.NoError(t, json.Unmarshal(buf.Bytes(), &got))
735 assert.Equal(t, want, got)
736}

Callers 2

Calls 4

AppendByteMethod · 0.80
BytesMethod · 0.80
GetMethod · 0.45
FreeMethod · 0.45

Tested by

no test coverage detected