Registry / testing / proptest-derive

proptest-derive

JSON →
library0.8.0rscratesunverified

Custom-derive for the Arbitrary trait of proptest, enabling automatic test case generation.

# Cargo.toml [dependencies] proptest-derive = "0.8.0"
INSTALL
IMPORT
SIG · PROPTEST-DERIVE
P
proptest-derive
testingrustv0.8.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Arbitrary
use proptest_derive::Arbitrary;

Derive Arbitrary for a struct to use in property-based tests.

use proptest::prelude::*; use proptest_derive::Arbitrary; #[derive(Arbitrary, Debug)] struct Point { x: i32, y: i32 } proptest! { #[test] fn test_point(p: Point) { assert!(p.x.abs() < 1000); } }
Debug
Known issues
gotchaRequires the `proptest` crate as a dependency.
fix
Add `proptest` to dev-dependencies and use `#[cfg(test)]` for test modules.
affects: >=0.8.0
Upgrade
Version history
0.8.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
7 hits · last 30 days
node
6
Amazon
1
Resources
proptest-derive — cargo add proptest-derive · libregistry