Attribute Macro test_matrix
#[test_matrix]
Expand description
Generates tests for the cartesian product of a given set of data
A test matrix consists of three elements:
- (Required) Sets of values to combine; the nubmer of sets must be the same as the number of arguments to the test body function
- (Optional) Expected result (for all combinations of values)
- (Required) Test body
Expected result and Test body are the same as they are for the singular #[test_case(...)]
macro but are applied to every case generated by #[test_matrix(...)]
. Test case description
is not allowed for test_matrix
, because test case names are auto-generated from the test body
function name and matrix values.