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

#843 in Testing

Download history 29201/week @ 2024-02-06 27250/week @ 2024-02-13 25436/week @ 2024-02-20 24278/week @ 2024-02-27 21806/week @ 2024-03-05 29314/week @ 2024-03-12 21448/week @ 2024-03-19 24795/week @ 2024-03-26 25298/week @ 2024-04-02 27500/week @ 2024-04-09 27491/week @ 2024-04-16 27620/week @ 2024-04-23 22039/week @ 2024-04-30 30097/week @ 2024-05-07 29525/week @ 2024-05-14 23349/week @ 2024-05-21

109,725 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