(t *testing.T)
| 278 | } |
| 279 | |
| 280 | func TestHeadTailBuffer_BytesReturnsCopy(t *testing.T) { |
| 281 | t.Parallel() |
| 282 | |
| 283 | buf := agentproc.NewHeadTailBuffer() |
| 284 | _, err := buf.Write([]byte("original")) |
| 285 | require.NoError(t, err) |
| 286 | |
| 287 | b := buf.Bytes() |
| 288 | require.Equal(t, []byte("original"), b) |
| 289 | |
| 290 | // Mutating the returned slice should not affect the |
| 291 | // buffer. |
| 292 | b[0] = 'X' |
| 293 | require.Equal(t, []byte("original"), buf.Bytes()) |
| 294 | } |
| 295 | |
| 296 | func TestHeadTailBuffer_RingBufferWraparound(t *testing.T) { |
| 297 | t.Parallel() |
nothing calls this directly
no test coverage detected