Skip to main content

Module testing

Module testing 

Source
Expand description

Duplex-backed test harness for ACP connections.

test_connection returns a full (ConnectionTo<Client>, TestPeer) pair over an in-memory duplex transport. Use it for integration-style tests that need to exercise the full serialize/dispatch path (so wire-format regressions like extension method-name typos surface in tests).

When a test needs to pass a real Responder<ElicitationResponse> into a component under test (e.g. an elicitation UI) and observe what that component eventually sends, call TestPeer::fake_elicitation: it kicks off a placeholder elicitation request, hands back the captured responder, and returns a receiver that resolves when the responder is consumed.

Structs§

TestPeer

Functions§

duplex_pair
In-memory ACP transport pair: (agent_transport, client_transport). Hand each half to a connect_to / connect_with call on the corresponding side. Must be used inside a LocalSet since the runners are spawn_local’d.
test_connection
Build a live ConnectionTo<Client> over an in-memory duplex transport with a peer on the other end. Must be called inside a LocalSet.

Type Aliases§

DuplexByteStreams