1 unstable release

0.1.1 Aug 15, 2024
0.1.0 Aug 15, 2024

#622 in Testing

Download history 99/week @ 2024-08-09 185/week @ 2024-08-16 56/week @ 2024-08-23 43/week @ 2024-08-30 44/week @ 2024-09-06 95/week @ 2024-09-13 71/week @ 2024-09-20 55/week @ 2024-09-27 51/week @ 2024-10-04 49/week @ 2024-10-11 41/week @ 2024-10-18 34/week @ 2024-10-25 47/week @ 2024-11-01 41/week @ 2024-11-08 42/week @ 2024-11-15 14/week @ 2024-11-22

149 downloads per month
Used in squint

MIT/Apache

8KB

Prop-test

Utility for the proptest crate, which provides a macro that is formattable with rustfmt.

Unlike the original proptest!() macro, this macro isn't expected to "wrap" test functions but is instead intended to be placed as expressions within them.

Example

fn reverse<T: Clone>(xs: &[T]) -> Vec<T> {
    xs.iter().rev().cloned().collect()
}

use prop_test::prelude::*;

// This expression would be inside of a `#[test]` function
prop_test!(&prop::collection::vec(any::<i32>(), 0..100), |xs| {
    prop_assert_eq!(&xs, &reverse(&reverse(&xs)));
    Ok(())
});

Dependencies

~3.5MB
~67K SLoC