(t *testing.T)
| 204 | } |
| 205 | |
| 206 | func TestWaitBuffer_RequireWaitFor_Timeout(t *testing.T) { |
| 207 | t.Parallel() |
| 208 | |
| 209 | // Use a mock testing.TB to capture the fatal call without |
| 210 | // killing the real test. |
| 211 | mock := &tbMock{} |
| 212 | ctx, cancel := context.WithCancel(context.Background()) |
| 213 | cancel() |
| 214 | |
| 215 | wb := testutil.NewWaitBuffer() |
| 216 | _, err := wb.Write([]byte("some output")) |
| 217 | require.NoError(t, err) |
| 218 | |
| 219 | wb.RequireWaitFor(ctx, mock, "missing-signal") |
| 220 | assert.True(t, mock.failed(), "expected RequireWaitFor to fail the mock test") |
| 221 | } |
| 222 | |
| 223 | // tbMock is a minimal testing.TB that records Fatalf calls. |
| 224 | type tbMock struct { |
nothing calls this directly
no test coverage detected