MCPcopy Create free account
hub / github.com/coder/agentapi / advanceFor

Function advanceFor

lib/screentracker/pty_conversation_test.go:64–68  ·  view source on GitHub ↗

advanceFor is a shorthand for advanceUntil with a time-based condition.

(ctx context.Context, t *testing.T, mClock *quartz.Mock, total time.Duration)

Source from the content-addressed store, hash-verified

62
63// advanceFor is a shorthand for advanceUntil with a time-based condition.
64func 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

Callers 6

statusTestFunction · 0.85
TestMessagesFunction · 0.85
TestStatePersistenceFunction · 0.85
TestInitialPromptSentFunction · 0.85

Calls 2

advanceUntilFunction · 0.85
AddMethod · 0.80

Tested by

no test coverage detected