forked from SoniEx2/rust.eventbus
19 lines
330 B
Rust
19 lines
330 B
Rust
|
#[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);
|
||
|
}
|