2021-06-29 08:52:29 +00:00
|
|
|
use crate::helper::*;
|
|
|
|
use flowy_sys::prelude::*;
|
|
|
|
|
|
|
|
pub async fn hello() -> String { "say hello".to_string() }
|
|
|
|
|
2021-07-02 12:45:51 +00:00
|
|
|
#[tokio::test]
|
|
|
|
async fn test_init() {
|
|
|
|
setup_env();
|
2021-06-29 08:52:29 +00:00
|
|
|
let event = "1";
|
2021-07-03 06:14:10 +00:00
|
|
|
init_dispatch(|| vec![Module::new().event(event, hello)]);
|
2021-06-29 08:52:29 +00:00
|
|
|
|
2021-07-08 05:47:11 +00:00
|
|
|
let request = ModuleRequest::new(event);
|
|
|
|
let _ = EventDispatch::async_send(request, |resp| {
|
|
|
|
Box::pin(async move {
|
|
|
|
dbg!(&resp);
|
|
|
|
})
|
|
|
|
})
|
2021-07-07 14:24:26 +00:00
|
|
|
.await;
|
2021-06-29 08:52:29 +00:00
|
|
|
}
|