(t *testing.T)
| 17 | } |
| 18 | |
| 19 | func TestCooldownManager_SetAndGet(t *testing.T) { |
| 20 | t.Parallel() |
| 21 | |
| 22 | clock := newFakeClock(time.Date(2024, 1, 1, 0, 0, 0, 0, time.UTC)) |
| 23 | m := newCooldownManager(clock.Now) |
| 24 | |
| 25 | m.Set("agent-A", 2, time.Minute) |
| 26 | |
| 27 | state := m.Get("agent-A") |
| 28 | require.NotNil(t, state) |
| 29 | assert.Equal(t, 2, state.fallbackIndex) |
| 30 | assert.True(t, state.until.After(clock.Now()), "until must be in the future") |
| 31 | } |
| 32 | |
| 33 | func TestCooldownManager_GetEvictsExpired(t *testing.T) { |
| 34 | t.Parallel() |
nothing calls this directly
no test coverage detected