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.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).

PropTest

struct PropTest

A property test runner.

Implemented traits

AnyType, ImplicitlyDestructible, Movable

Methods

__init__

__init__(out self)

Construct a new property test runner with the default configuration.

Returns:

Self: A new property test runner with the default configuration.

__init__(out self, *, var config: PropTestConfig)

Construct a new property test runner.

Args:

  • config (PropTestConfig): The configuration for the property test.

test

test[StrategyType: Strategy, //, f: def(var StrategyType.Value) raises capturing -> None](self, var strategy: StrategyType)

Run a property test with the given strategy.

Parameters:

  • StrategyType (Strategy): The strategy type to use for the property test.
  • f (def(var StrategyType.Value) raises capturing -> None): The function to test.

Args:

  • strategy (StrategyType): The strategy value to use for the property test.

Raises:

An error if the property test fails.