[][src]Module un_algebra::tests

Generative testing support for un_algebra axioms and properties.

The tests module provides random value generators and testing configuration helper functions for un_algebra generative tests.

Re-exports

pub use self::config::*;
pub use self::float::*;

Modules

arbitrary

Defines the Arbitrary trait and related free functions and type aliases.

array

Support for strategies producing fixed-length arrays.

bits

Strategies for working with bit sets.

bool

Strategies for generating bool values.

char

Strategies for generating char values.

collection

Strategies for generating std::collections of values.

config

Testing configurations for proptest tests.

float

Floating point error bounds for generative tests.

num

Strategies to generate numeric values (as opposed to integers used as bit fields).

option

Strategies for generating std::Option values.

prelude

Re-exports the most commonly-needed APIs of proptest.

prop

Re-exports the entire public API of proptest so that an import of prelude allows simply writing, for example, prop::num::i32::ANY rather than proptest::num::i32::ANY plus a separate use proptest;.

result

Strategies for combining delegate strategies into std::Results.

sample

Strategies for generating values by taking samples of collections.

strategy

Defines the core traits used by Proptest.

string

Strategies for generating strings and byte strings from regular expressions.

test_runner

State and functions for running proptest tests.

tuple

Support for combining strategies into tuples.

Macros

prop_assert

Similar to assert! from std, but returns a test failure instead of panicking if the condition fails.

prop_assert_eq

Similar to assert_eq! from std, but returns a test failure instead of panicking if the condition fails.

prop_assert_ne

Similar to assert_ne! from std, but returns a test failure instead of panicking if the condition fails.

prop_assume

Rejects the test input if assumptions are not met.

prop_compose

Convenience to define functions which produce new strategies.

prop_oneof

Produce a strategy which picks one of the listed choices.

proptest

Easily define proptest tests.

Structs

Config

Configuration for how a proptest test should be run.

MapFailurePersistence

Failure persistence option that loads and saves seeds in memory on the heap. This may be useful when accumulating test failures across multiple TestRunner instances for external reporting or batched persistence.

PersistedSeed

Opaque struct representing a seed which can be persisted.

Reason

The reason for why something, such as a generated value, was rejected.

ResultCacheKey

A key used for the result cache.

TestRng

Proptest's random number generator.

TestRunner

State used when running a proptest test.

Enums

FileFailurePersistence

Describes how failing test cases are persisted.

RngAlgorithm

Identifies a particular RNG algorithm supported by proptest.

TestCaseError

Errors which can be returned from test cases to indicate non-successful completion.

TestError

A failure state from running test cases for a single test.

Traits

FailurePersistence

Provides external persistence for historical test failures by storing seeds.

ResultCache

An object which can cache the outcomes of tests.

Rng

An automatically-implemented extension trait on RngCore providing high-level generic methods for sampling values and other convenience methods.

RngCore

The core of a random number generator.

Functions

basic_result_cache

A basic result cache.

noop_result_cache

A result cache that does nothing.

Type Definitions

TestCaseResult

Convenience for the type returned by test cases.