Skip to main content

Module rules

Module rules 

Expand description

The projection conformance rules.

Each rule is an independent async function taking impl AsyncFn() -> F: not a fixture, but how to make one. A rule that can call open() twice can make two genuinely isolated projection stores, which is what commit_rejects_a_foreign_batch needs and what no meta-test over the testkit’s own fixture could substitute for.

They are public so an adapter can call one directly when debugging a single failure, exactly as crate::rules is.

Functions§

batch_reads_reflect_pending_writes
An open batch can be read through, and sees its own pending writes.
commit_accepts_a_position_the_batch_did_not_write
A commit may name a position no applied write occupies.
commit_advances_the_checkpoint
A commit moves the projection’s checkpoint to the position it was given.
commit_is_atomic_with_the_read_model
The read-model write and the checkpoint write become durable together, or neither does.
commit_rejects_a_foreign_batch
A batch begun on one store instance is rejected by another, and neither store moves.
commit_rejects_a_regressing_position
A commit naming a position strictly below the current checkpoint is refused, and neither half moves.
committed_rows_and_checkpoint_survive_a_reopen
A committed read-model row and its checkpoint are both still there after every handle is dropped and the fixture reopens its storage.
distinct_projections_advance_independently
One commit advances exactly one ProjectionId.
dropped_batch_leaves_store_usable
A batch dropped bare rolls back and leaves the store usable.
failed_commit_leaves_both_unchanged
A commit that reported failure left the read model and the checkpoint exactly as they were.
fresh_projection_has_no_checkpoint
A projection the store has never seen reads back as Checkpoint::NeverRun.
projection_ids_round_trip_by_bytes
Every id ProjectionId::new accepts names its own checkpoint, kept by its exact bytes through commit, checkpoint and reset.
rebuild_is_chunk_size_invariant
A rebuild produces the same read model however it is chunked.
rebuilding_is_distinguishable_from_live
A projection being rebuilt is distinguishable from one serving live.
refused_reset_changes_nothing
A refused reset leaves the read model and the checkpoint exactly as they were, and is never reported as success.
reset_clears_rows_and_checkpoint_together
A reset applies the caller’s batch and returns the checkpoint to Checkpoint::NeverRun as one unit of work.
reset_is_not_commit_at_first
reset is distinguishable from commit(empty_batch, id, FIRST, Live), in the checkpoint and in the replay that follows it.
reset_is_scoped_to_one_projection
A reset moves exactly one (store, ProjectionId) pair.
rollback_leaves_both_unchanged
An explicit rollback leaves the read model and the checkpoint exactly as the last successful commit left them.