Skip to main content

Mojo struct

PropTest

struct PropTest

A property test runner.

Implemented traits

AnyType, Movable, UnknownDestructibility

Aliases

__del__is_trivial

alias __del__is_trivial = True

__moveinit__is_trivial

alias __moveinit__is_trivial = True

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: fn(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 (fn(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.

Was this page helpful?