parameters

Attribute Macro parameters 

Source
#[parameters]
Expand description

Convert a single argument function into a parameterized function. The expected function signature is a single argument function (can be any type) that returns an ExtelResult.

While technically possible, this macro is not intended to be used to run tests manually. This macro is specifically for the purpose of helping the test initializer prepare parameterized tests.

ยงExample

use extel::prelude::*;
use extel_parameterized::parameters;

#[parameters(2, 4)]
fn less_than_3(x: i32) -> ExtelResult {
    extel_assert!(x < 3, "{} >= 3", x)
}

assert!(matches!(
    &less_than_3()[..],
    [
        Ok(_),
        Err(Error::TestFailed(_))
    ]
));

This is only available with the parameterized feature enabled.