nw-pbt-rust
FeaturedRust property-based testing with proptest, quickcheck, and bolero frameworks
Testing & QA 636 stars
68 forks Updated today MIT
Install
Quality Score: 98/100
Stars 20%
Recency 20%
Frontmatter 20%
Documentation 15%
Issue Health 10%
License 10%
Description 5%
Skill Content
# PBT Rust -- proptest, quickcheck, bolero
## Framework Selection
| Framework | Shrinking | Stateful | Choose When |
|-----------|-----------|----------|-------------|
| proptest | Integrated | No | Default choice. Most features, best shrinking. |
| quickcheck | Type-based | No | Simple properties, one generator per type sufficient |
| bolero | Engine-dependent | No | Want to switch between PBT and fuzzing engines |
**Default**: proptest. Supports multiple strategies per type without newtype wrappers, better shrinking.
## Quick Start (proptest)
```rust
use proptest::prelude::*;
proptest! {
#[test]
fn sort_preserves_length(ref v in prop::collection::vec(any::<i32>(), 0..100)) {
let mut sorted = v.clone();
sorted.sort();
prop_assert_eq!(sorted.len(), v.len());
}
}
// Run: cargo test
```
## Generator (Strategy) Cheat Sheet (proptest)
### Primitives
```rust
any::<i32>() // any i32
0..100i32 // range (implements Strategy)
any::<f64>()
any::<String>()
any::<bool>()
any::<Vec<u8>>() // bytes
Just(42) // constant
```
### Collections
```rust
prop::collection::vec(any::<i32>(), 0..50)
prop::collection::vec(any::<i32>(), 1..=10) // non-empty, max 10
prop::collection::hash_set(any::<i32>(), 0..20)
prop::collection::hash_map(any::<String>(), any::<i32>(), 0..20)
(any::<i32>(), any::<String>()) // tuple
```
### Combinators
```rust
// ...
Details
- Author
- nWave-ai
- Repository
- nWave-ai/nWave
- Created
- 9 months ago
- Last Updated
- today
- Language
- Python
- License
- MIT
Similar Skills
Semantically similar based on skill content — not just same category
Testing & QA Featured
nw-pbt-haskell
Haskell property-based testing with QuickCheck and Hedgehog frameworks
636 Updated today
nWave-ai Testing & QA Featured
nw-pbt-go
Go property-based testing with rapid and gopter frameworks
636 Updated today
nWave-ai Testing & QA Featured
nw-pbt-typescript
TypeScript/JavaScript property-based testing with fast-check framework and arbitraries
636 Updated today
nWave-ai