Current test framework only tests success or panics. With macros, they aren’t always fully hygienic, so sometimes you wanna test your own hygiene.
Take for example eventbus. This shouldn’t compile:
#[macro_use]
extern crate eventbus;
use eventbus::{Event, EventBus};
struct MyEvent {
i: i32
}
impl Event for MyEvent {
}
#[test]
fn test_hygiene() {
let bus = [EventBus::new()];
let mut event = MyEvent { i: 3 };
post_event!(&bus[EVENT_ID.load(::std::sync::atomic::Ordering::Relaxed)], MyEvent, &mut event);
}
And (as of eventbus 0.4.0) it doesn’t, but there’s no way to automatically test it.