Skip to main content

Module testgen

Module testgen 

Source
Expand description

Deterministic random value generation for tests (feature testgen).

Every generated type implements Generate. Generated values are always encodable: switch discriminants are generated first and conditional fields follow them, counts match their arrays, packed fields are in range. Values are biased toward the case keys that switches compare against, so every branch gets exercised.

This module is test support, not part of the stable API.

Structs§

Gen
Seeded pseudo-random generator (SplitMix64).

Traits§

Generate
A type that can produce random values.

Functions§

first_byte_ok
Encodes with f and checks the first written byte with pred (used to keep generated entity-metadata entries from looking like terminators).