Skip to main content

Module testing

Module testing 

Source

Functionsยง

agent_ctx
Build an AgentCtx over a caller-owned laser and message, so a handler test can call handle(&message, &ctx) directly. The ctx borrows both, so keep them alive for the duration of the call. The laser supplies whatever IO the ctx helpers use (point it at a test server for respond/fan_out). A handler that only reads its message needs no server at all.
agent_message
Build an AgentMessage for a handler unit test: a plain (non-envelope) message carrying payload and provenance, seated at the start of a synthetic partition. Feed it to an AgentHandler to exercise the handler without the reliable consumer or a live server.