Attribute Macro test_case::test_matrix

source ·
Expand description

Generates tests for the cartesian product of a given set of data

A test matrix consists of four elements:

  1. (Required) Sets of values to combine; the number of sets must be the same as the number of arguments to the test body function
  2. (Optional) Expected result (for all combinations of values)
  3. (Optional) Test case description (applied as a prefix the generated name of the test)
  4. (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(...)].