advanceFor is a shorthand for advanceUntil with a time-based condition.
(ctx context.Context, t *testing.T, mClock *quartz.Mock, total time.Duration)
| 62 | |
| 63 | // advanceFor is a shorthand for advanceUntil with a time-based condition. |
| 64 | func advanceFor(ctx context.Context, t *testing.T, mClock *quartz.Mock, total time.Duration) { |
| 65 | t.Helper() |
| 66 | target := mClock.Now().Add(total) |
| 67 | advanceUntil(ctx, t, mClock, func() bool { return !mClock.Now().Before(target) }) |
| 68 | } |
| 69 | |
| 70 | // advanceUntil advances the mock clock one event at a time until done returns |
| 71 | // true. Because the snapshot TickerFunc is always pending and WaitFor reuses a |
no test coverage detected