debug_format_tests

Macro debug_format_tests 

Source
macro_rules! debug_format_tests {
    (
        enum_type: $enum_name:ty,
        tests: [
            $(($test_name:ident, $variant:expr, $expected:expr)),+ $(,)?
        ]
    ) => { ... };
}
Expand description

Generate debug format tests for multiple enum variants.

This macro creates a test for each variant that checks its Debug output.

§Examples

debug_format_tests! {
    enum_type: MyEnum,
    tests: [
        (test_first_debug, MyEnum::First, "First"),
        (test_second_debug, MyEnum::Second, "Second"),
        (test_third_debug, MyEnum::Third, "Third"),
    ]
}