Macro droptest::assert_drop[][src]

macro_rules! assert_drop {
    ($registry : expr, $guard_id : expr) => { ... };
    ($registry : expr, $guard_id : expr $(, $message : tt) +) => { ... };
}
Expand description

Asserts that the registry has registered a drop for the given id.

Like assert!, this macro has a second form, where a custom panic message can be provided.

Examples

use droptest::prelude::*;

let registry = DropRegistry::default();
let guard = registry.new_guard();
let id = guard.id();

std::mem::drop(guard);

assert_drop!(registry, id);
// or:
assert_drop!(registry, id, "an optional message");