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

Struct mockAgentIO

x/acpio/acp_conversation_test.go:20–34  ·  view source on GitHub ↗

mockAgentIO implements acpio.ChunkableAgentIO for testing. It provides a channel-based synchronization mechanism to test ACPConversation without relying on time.Sleep.

Source from the content-addressed store, hash-verified

18// It provides a channel-based synchronization mechanism to test ACPConversation
19// without relying on time.Sleep.
20type mockAgentIO struct {
21 mu sync.Mutex
22 written []byte
23 screenContent string
24 onChunkFn func(chunk string)
25
26 // Control behavior
27 writeErr error
28 // writeBlock is a channel that, if non-nil, will cause Write to block until closed.
29 // This allows tests to control when the write completes.
30 writeBlock chan struct{}
31 // writeStarted is closed when Write begins (before blocking on writeBlock).
32 // This allows tests to synchronize on the write starting.
33 writeStarted chan struct{}
34}
35
36// mockEmitter implements screentracker.Emitter for testing.
37type mockEmitter struct {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected