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

macro ntest_test_cases

Test cases for ntest framwork

15 releases

✓ Uses Rust 2018 edition

new 0.2.1 Sep 9, 2019
0.2.0 Sep 7, 2019
0.1.13 Sep 3, 2019
0.1.10 Aug 30, 2019

#115 in Testing

Download history 27/week @ 2019-08-05 26/week @ 2019-08-12 1/week @ 2019-08-19 136/week @ 2019-08-26 110/week @ 2019-09-02

105 downloads per month
Used in 1 crate

Custom license

13KB
197 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

~0.7–1MB
~22K SLoC