35 releases

0.9.2 Mar 8, 2024
0.9.0 Nov 11, 2022
0.8.0 May 31, 2022
0.7.5 Feb 25, 2022
0.3.3 Sep 20, 2019

#74 in #test-cases

Download history 9363/week @ 2023-12-24 24841/week @ 2023-12-31 22863/week @ 2024-01-07 32295/week @ 2024-01-14 33969/week @ 2024-01-21 28483/week @ 2024-01-28 30458/week @ 2024-02-04 27724/week @ 2024-02-11 24576/week @ 2024-02-18 23159/week @ 2024-02-25 23343/week @ 2024-03-03 26751/week @ 2024-03-10 24174/week @ 2024-03-17 23754/week @ 2024-03-24 25190/week @ 2024-03-31 19490/week @ 2024-04-07

95,241 downloads per month
Used in 58 crates (via ntest)

MIT license

16KB
248 lines

NTest TestCases

Part of the NTest library. Add test cases to the rust test framework using procedural macros.

Examples

Example with a single argument:

#[test_case(13)]
#[test_case(42)]
fn one_arg(x: u32) {
    assert!(x == 13 || x == 42)
}

The test cases above will be parsed at compile time and two rust test functions will be generated instead:

#[test]
fn one_arg_13() {
    x = 13;
    assert!(x == 13 || x == 42)
}

#[test]
fn one_arg_42() {
    x = 42;
    assert!(x == 13 || x == 42)
}

For more examples and information read the documentation.


lib.rs:

Part of the ntest library. Add test cases to the rust test framework.

Dependencies

~1.5MB
~35K SLoC