36 releases

0.9.3 Jun 19, 2024
0.9.2 Mar 8, 2024
0.9.0 Nov 11, 2022
0.8.0 May 31, 2022
0.3.3 Sep 20, 2019

#82 in #test-cases

Download history 34853/week @ 2024-07-23 32201/week @ 2024-07-30 36937/week @ 2024-08-06 33238/week @ 2024-08-13 51186/week @ 2024-08-20 29910/week @ 2024-08-27 29226/week @ 2024-09-03 27108/week @ 2024-09-10 25539/week @ 2024-09-17 25597/week @ 2024-09-24 31737/week @ 2024-10-01 35865/week @ 2024-10-08 29057/week @ 2024-10-15 28696/week @ 2024-10-22 31810/week @ 2024-10-29 24436/week @ 2024-11-05

119,261 downloads per month
Used in 65 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
~36K SLoC