4 ms·
I assume you're asking about authoring one's own `macro_rules!`? I find them handy when writing tests (especially integration tests) to create sub-modules that
by bobbylarrybobby 5y ago
I assume you're asking about authoring one's own `macro_rules!`? I find them handy when writing tests (especially integration tests) to create sub-modules that all function the same way, just with different input-output pairs. This is better than using functions because each module can contain multiple functions to test. So instead of `test1a(input1, output1); test1b(input1, output1)`, I have a macro `test_input_output!(test1, input1, output1)` which generates `mod test1` containing the individual tests.