IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /docs/manual/basics.md). For the complete Mojo documentation index, see llms.txt.
Skip to main content
Version: 1.1.0
For the complete Mojo documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /docs/manual/basics.md).

Strategy

A type used to produce random inputs for property tests.

Strategies are a core building block of property testing. They are used to produce the random input values for the properties being tested.

Implemented traits​

AnyType, Deinitable, Movable

comptime members​

Value​

comptime Value

The type the strategy produces.

Required methods​

value​

def value(mut self, mut rng: Rng) -> Self.Value

Produces a random value using this strategy.

Args:

  • ​rng (Rng): The random number generator to use.

Returns:

_Self.Value: A random value.

Raises:

If the underlying Rng raises an error.