Skip to main content

Module strategies

Module strategies 

Available on crate feature proptest only.
Expand description

proptest strategies over the contract’s value types.

These live here, in a public module of the testkit, rather than in a test binary, because the testkit’s own claim about them is that an adapter pushing query matching down into SQL is asserting the same laws about its WHERE clause and should be able to reuse the generators. Generators private to an integration test are reachable by nobody, which made that claim false.

Behind the off-by-default proptest feature: proptest does not build for wasm32-unknown-unknown, and the mandatory wasm32 step of cargo xtask ci must stay buildable. --all-features turns it on.

Write your proptest! blocks against the [proptest] re-export above rather than a second dependency entry of your own; see its documentation for what goes wrong otherwise.

Functions§

any_event
Generates an Event: a type, a tag set, a small payload, and metadata half the time.
any_event_type
Generates an EventType from a three-symbol alphabet, for the same reason any_tag’s is five.
any_query
Generates a Query, weighted towards Items — All has one behaviour and needs one sample, not a third of them.
any_query_item
Generates a QueryItem over the alphabets above.
any_tag
Generates a tag from a five-symbol alphabet.
any_tags
Generates a canonical Tags of up to six tags from any_tag.