mod.rsannotatedmod.rssource24 lines · 1.3 KB · raw

The conformance suite: the contracts of whiskers-ports, written as functions generic over an adapter. An adapter's own tests call these with a way to make a fresh one (and, for the durable ports, a way to restart one on the same storage). The suite is the specification: if a contract needs to change, the law here changes with it, and every adapter is held to it at once.

Nothing in the suite uses a thread, a clock or a file, so it builds for a Worker too; an adapter that needs a real runtime supplies it around these calls. The laws are synchronous because every adapter whose futures never wait can be driven by whiskers_ports::run_ready; an adapter that does wait (a Durable Object) is driven by its own harness, which wraps each call in a runner.

Laws are selected by capability (see [fixture]). Each law set names, in the fixture trait it needs, the one capability it judges, and a [fixture::Suite] can run it only for a harness that provides that fixture: an adapter without a journal has no JournalFixture and so has no way to select the journal's laws, rather than skipping them.

16pub mod allowance;
17pub mod build;
18pub mod fixture;
19pub mod hubs;
20pub mod journal;
21pub mod outbound;
22pub mod pictures;
23pub mod secrets;
24pub mod timing;