Skip to main content

any_tag

Function any_tag 

pub fn any_tag() -> impl Strategy<Value = Tag>
Available on crate feature proptest only.
Expand description

Generates a tag from a five-symbol alphabet.

The alphabet is the point, and it is why this is exported rather than described. Over "a".."e" a generated Tags of length up to six has collisions and duplicates in almost every case; over anything wider they are vanishingly unlikely, and a merge-scan that is wrong exactly at a duplicate boundary is never handed one. An adapter author writing their own generator will reach for something realistic and will therefore never generate the inputs that break them.

§Panics

Panics during generation if a sampled value is not a valid Tag. Test-only helper; the alphabet is chosen so it cannot happen.

§Examples

use happenstance_testkit::fixtures::strategies;

// Constructing it is the check: if these were not public, this would not
// compile.
let _tag = strategies::any_tag();
let _tags = strategies::any_tags();
let _event_type = strategies::any_event_type();