test-better-property 0.2.1

Property-testing bridge for the test-better testing library.
Documentation
//! `test-better-property`: property-testing bridge.
//!
//! A property test states a fact that should hold for *every* input ("parsing
//! then serializing round-trips"), and the runner tries to break it with
//! generated inputs, shrinking any counterexample to its simplest form.
//!
//! This crate is the bridge between `test-better`'s `check!` idiom and a
//! property-testing backend. It has two pieces:
//!
//! - the [`Strategy`] seam (with [`ValueTree`], [`Runner`], [`GenError`]): a
//!   deliberately small trait the runner is written against. The shipped
//!   backend is `proptest`, which satisfies it through a blanket impl, so a
//!   property test names ordinary `proptest` strategies;
//! - the runner: [`for_all`] (and [`for_all_with`]) generate cases, run a
//!   `T -> TestResult` predicate, and on failure return a [`PropertyFailure`]
//!   carrying the shrunk counterexample.
//!
//! Behind the off-by-default `quickcheck` feature, [`arbitrary`] bridges a
//! `quickcheck::Arbitrary` type into the same seam: a best-effort second
//! backend that proves [`Strategy`] is a real seam. It is
//! honest about its reduced fidelity; see the [`quickcheck_bridge`] module docs.
//!
//! The [`property!`] macro is the test-facing front for all of this: it takes
//! a closure, infers a [`Strategy`] from the binding's type (or takes one with
//! a `using` clause), and runs it through [`for_all`]. Rich shrunk-failure
//! rendering builds on the same surface.

mod check;
mod property;
#[cfg(feature = "quickcheck")]
pub mod quickcheck_bridge;
mod strategy;

pub use check::{Config, PropertyFailure, for_all, for_all_with};
pub use property::{render_failure, run_property};
#[cfg(feature = "quickcheck")]
pub use quickcheck_bridge::{ArbitraryStrategy, QuickcheckTree, arbitrary};
pub use strategy::{GenError, ProptestTree, Runner, Strategy, ValueTree, any};