[][src]Macro rslint_core::rule_tests

macro_rules! rule_tests {
    ($rule:expr,
    err: {
        $(
            // An optional tag to give to docgen
            $(#[$err_meta:meta])*
            $code:literal
        ),* $(,)?
    },

    // Optional doc used in the user facing docs for the
    // more valid code examples section.
    $(#[_:meta])*
    ok: {
        $(
            // An optional tag to give to docgen
            $(#[$ok_meta:meta])*
            $ok_code:literal
        ),* $(,)?
    } $(,)?) => { ... };
    (
    $ok_name:ident,
    $err_name:ident,
    $rule:expr,
    err: {
        $(
            // An optional tag to give to docgen
            $(#[$err_meta:meta])*
            $code:literal
        ),* $(,)?
    },
    ok: {
        $(
            // An optional tag to give to docgen
            $(#[$ok_meta:meta])*
            $ok_code:literal
        ),* $(,)?
    } $(,)?) => { ... };
}

A macro for generating linter rule tests.

The tests are also used to generate "more examples" sections in user facing docs. You can use a /// ignore doc on a code expr to make docgen ignore it for user facing docs.

test code is run as modules, not scripts.