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

#1265 in Testing

Download history 27388/week @ 2024-12-02 22858/week @ 2024-12-09 20553/week @ 2024-12-16 13006/week @ 2024-12-23 16025/week @ 2024-12-30 32842/week @ 2025-01-06 36749/week @ 2025-01-13 35781/week @ 2025-01-20 31403/week @ 2025-01-27 34148/week @ 2025-02-03 29954/week @ 2025-02-10 39321/week @ 2025-02-17 38588/week @ 2025-02-24 42043/week @ 2025-03-03 41004/week @ 2025-03-10 51170/week @ 2025-03-17

176,372 downloads per month
Used in 74 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
~37K SLoC