Macro utils::async_property_test
source · macro_rules! async_property_test { ( $test_func:ident => [$( // Test function to call, followed by list of test cases. $(#[$attr:meta])* // Optional attributes. $test_name:ident( // Test case name. $($args:expr),+$(,)? // Arguments for test case. ) ),+$(,)?] ) => { ... }; }
Expand description
Macro for generating multiple tests from a common test function
Example
async_property_test!(test_to_run,
case1(0, String::from("abc")),
case2(1, String::from("xyz")),
);
async fn test_to_run(prop1: usize, prop2: String) {
assert!(prop1 < 2);
assert_eq!(prop2.chars().len(), 3);
}