(t *testing.T)
| 213 | } |
| 214 | |
| 215 | func TestHeadTailBuffer_TruncationInfoFields(t *testing.T) { |
| 216 | t.Parallel() |
| 217 | |
| 218 | buf := agentproc.NewHeadTailBufferSized(10, 10) |
| 219 | |
| 220 | // Write enough to cause omission. |
| 221 | data := strings.Repeat("D", 50) |
| 222 | _, err := buf.Write([]byte(data)) |
| 223 | require.NoError(t, err) |
| 224 | |
| 225 | _, info := buf.Output() |
| 226 | require.NotNil(t, info) |
| 227 | require.Equal(t, 50, info.OriginalBytes) |
| 228 | require.Equal(t, 30, info.OmittedBytes) |
| 229 | require.Equal(t, "head_tail", info.Strategy) |
| 230 | // RetainedBytes is the length of the formatted output |
| 231 | // string including the omission marker. |
| 232 | require.Greater(t, info.RetainedBytes, 0) |
| 233 | } |
| 234 | |
| 235 | func TestHeadTailBuffer_MultipleSmallWrites(t *testing.T) { |
| 236 | t.Parallel() |
nothing calls this directly
no test coverage detected