Skip to content

Latest commit

 

History

History
34 lines (25 loc) · 894 Bytes

File metadata and controls

34 lines (25 loc) · 894 Bytes

disprove

Property-based testing for Rust — a modern, maintained replacement for quickcheck.

Features

  • API-compatible with quickcheck for easy migration
  • Const generics support for arrays of any size
  • Deterministic seeds via QUICKCHECK_SEED for reproducible failures
  • More Arbitrary impls for newer std types
  • #[quickcheck] proc macro for ergonomic test definitions
  • Rust 1.75+ MSRV

Usage

use disprove::{quickcheck, Arbitrary, Gen};

fn prop_sort_is_idempotent(mut xs: Vec<i32>) -> bool {
    xs.sort();
    let sorted = xs.clone();
    xs.sort();
    xs == sorted
}

#[test]
fn test_sort() {
    quickcheck(prop_sort_is_idempotent as fn(Vec<i32>) -> bool);
}

License

Licensed under either of Apache License, Version 2.0 or MIT License at your option.