noprop 0.0.1

Imperative property-based testing library with no dependencies, no macros, no unsafe, and no implicit I/O
Documentation

noprop

noprop Documentation Actions Status License

An imperative property-based testing library for Rust.

  • No dependencies
  • No macros
  • No unsafe code (#![forbid(unsafe_code)])
  • No implicit I/O — seeds are always caller-supplied, so every run is fully reproducible
  • Imperative API — properties are plain Fn(&mut Rng) -> Result<(), Box<dyn Error>> closures that use ordinary Rust control flow (if / match / for) instead of combinator DSLs
  • Automatic value trace — each noprop::gen_* call is recorded at its source location and surfaced on failure, so the failing input is visible without extra plumbing

Example

use noprop::{Runner, gen_u32};

#[test]
fn addition_is_commutative() -> noprop::Result<()> {
    Runner { seed: 0xDEAD_BEEF, iterations: 1024 }.run(|rng| {
        let a = gen_u32(rng);
        let b = gen_u32(rng);
        assert_eq!(a.wrapping_add(b), b.wrapping_add(a));
        Ok(())
    })
}

Status

Early development (v0.0.x). API is unstable and may change without notice.