[][src]Attribute Macro ntest_test_cases::test_case

#[test_case]

Test cases can be used to have multiple inputs for a given function. With the test_case attribute multiple tests will be generated using the Procedural Macros capabilities of rust.

Examples

Example with a single argument

This example is not tested
#[test_case(13)]
#[test_case(42)]
fn one_arg(x: u32) {
    assert!(x == 13 || x == 42)
}

Example with multiple arguments:

This example is not tested
#[test_case(13, 13)]
#[test_case(42, 42)]
fn two_args(x: u32, y: u32) {
    assert_eq!(x, y);
}