Skip to main content

storage_conformance_tests

Macro storage_conformance_tests 

macro_rules! storage_conformance_tests {
    ($factory:expr $(,)?) => { ... };
    (@emit $factory:expr, $($check:ident),+ $(,)?) => { ... };
}
Expand description

Generates one #[test] per storage conformance check.

Takes an expression that evaluates to a factory closure returning a fresh Box<dyn Storage>. See the module documentation for the full walkthrough.

mod conformance {
    use atune_core::storage::{MemStorage, Storage};

    atune_core::storage_conformance_tests!(
        || Box::new(MemStorage::new()) as Box<dyn Storage>
    );
}

Requires atune_core’s conformance feature. The generated items have fixed names, so give the macro its own module.