prop_test/
lib.rs

1#![forbid(unsafe_code)]
2#![doc = include_str!("../README.md")]
3
4pub use proptest;
5
6pub mod prelude {
7    pub use crate::prop_test;
8    pub use proptest::prelude::*;
9}
10
11#[macro_export]
12macro_rules! prop_test {
13    ($strategy:expr, $test:expr, $config:expr) => {
14        let mut config = $config;
15        config.source_file = Some(file!());
16        let mut runner = $crate::proptest::test_runner::TestRunner::new(config);
17        match runner.run($strategy, $test) {
18            Ok(()) => (),
19            Err(e) => panic!("{e}\n{runner}"),
20        }
21    };
22    ($strategy:expr, $test:expr) => {
23        $crate::prop_test!(
24            $strategy,
25            $test,
26            $crate::proptest::test_runner::Config::default()
27        )
28    };
29}