#test #tests #unit #testing #test-cases

macro ntest_test_cases

Test cases for ntest framework

29 releases

0.7.3 Jan 6, 2021
0.7.2 Sep 8, 2020
0.7.1 May 24, 2020
0.6.0 Mar 6, 2020
0.3.3 Sep 20, 2019

#155 in Testing

Download history 1362/week @ 2020-12-25 1921/week @ 2021-01-01 2173/week @ 2021-01-08 2158/week @ 2021-01-15 2844/week @ 2021-01-22 2832/week @ 2021-01-29 3620/week @ 2021-02-05 3516/week @ 2021-02-12 3302/week @ 2021-02-19 3386/week @ 2021-02-26 2814/week @ 2021-03-05 3083/week @ 2021-03-12 3224/week @ 2021-03-19 4304/week @ 2021-03-26 2869/week @ 2021-04-02 2690/week @ 2021-04-09

10,649 downloads per month
Used in 11 crates (via ntest)

MIT license

15KB
239 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

~355–780KB
~19K SLoC