Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

runi-test

Curated test utilities: one dependency that brings rstest, pretty_assertions, and (behind a feature flag) proptest.

Install

[dev-dependencies]
runi-test = "0.1"
# With property-based testing support:
# runi-test = { version = "0.1", features = ["property"] }

Example

use runi_test::prelude::*;
use runi_test::pretty_assertions::assert_eq;

#[rstest]
#[case(2, 2, 4)]
#[case(3, 5, 8)]
fn adds(#[case] a: i32, #[case] b: i32, #[case] expected: i32) {
    assert_eq!(a + b, expected);
}

With the property feature enabled you also get proptest's macros and strategies through runi_test::prelude.