MCPcopy Index your code
hub / github.com/coder/coder / TestWriteFrameDataSize

Function TestWriteFrameDataSize

agent/boundarylogproxy/codec/codec_test.go:123–135  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

121}
122
123func TestWriteFrameDataSize(t *testing.T) {
124 t.Parallel()
125
126 var buf bytes.Buffer
127 data := make([]byte, codec.MaxMessageSizeV1)
128 err := codec.WriteFrame(&buf, codec.TagV1, data)
129 require.NoError(t, err)
130
131 //nolint: makezero // This intentionally increases the slice length.
132 data = append(data, 0) // One byte over the maximum
133 err = codec.WriteFrame(&buf, codec.TagV1, data)
134 require.ErrorIs(t, err, codec.ErrMessageTooLarge)
135}
136
137func TestWriteFrameInvalidTag(t *testing.T) {
138 t.Parallel()

Callers

nothing calls this directly

Calls 1

WriteFrameFunction · 0.92

Tested by

no test coverage detected