Module proptest::strategy

source ·
Expand description

Defines the core traits used by Proptest.

Modules

  • Modified versions of the normal strategy combinators which take specialised traits instead of normal functions.

Structs

  • A boxed Strategy trait object as produced by Strategy::boxed().
  • Options passed to check_strategy_sanity().
  • Strategy and ValueTree filter adaptor.
  • Strategy and ValueTree filter_map adaptor.
  • ValueTree corresponding to FilterMap.
  • Adaptor that flattens a Strategy which produces other Strategys into a Strategy that picks one of those strategies and then picks values from it.
  • The ValueTree produced by Flatten.
  • Adaptor for Strategy and ValueTree which guards simplify() and complicate() to avoid contract violations.
  • Similar to Flatten, but does not shrink the input strategy.
  • Similar to Map plus Flatten, but does not shrink the input strategy and passes the original input through.
  • A Strategy which always produces a single value value and never simplifies.
  • A Strategy which always produces a single value value and never simplifies. If T is Clone, you should use Just instead.
  • Represents a value tree that is initialized on the first call to any methods.
  • Strategy and ValueTree map adaptor.
  • Strategy and ValueTree map into adaptor.
  • Wraps a Strategy or ValueTree to suppress shrinking of generated values.
  • Strategy perturbation adaptor.
  • ValueTree perturbation adaptor.
  • Return type from Strategy::prop_recursive().
  • A boxed Strategy trait object which is also Sync and Send, as produced by Strategy::sboxed().
  • Strategy shuffle adaptor.
  • ValueTree shuffling adaptor.
  • Similar to Union, but internally uses a tuple to hold the strategies.
  • ValueTree type produced by TupleUnion.
  • A Strategy which picks from one of several delegate Stragegys.
  • ValueTree corresponding to Union.

Traits

  • A value which can be used with the prop_shuffle combinator.
  • A strategy for producing arbitrary values of a given type.
  • A generated value and its associated shrinker.

Functions

  • Run some tests on the given Strategy to ensure that it upholds the simplify/complicate contracts.
  • Convert a floating-point weight in the range (0.0,1.0) to a pair of weights that can be used with Union and similar.

Type Aliases

  • Shorthand for LazyJust<T, fn () -> T>.
  • A new ValueTree from a Strategy when Ok or otherwise Err when a new value-tree can not be produced for some reason such as in the case of filtering with a predicate which always returns false. You should pass in your strategy as the type parameter.
  • A relative weight of a particular Strategy corresponding to T coupled with T itself. The weight is currently given in u32.
  • A relative weight of a particular Strategy corresponding to T coupled with Arc<T>. The weight is currently given in u32.