2021-06-29 08:52:29 +00:00
|
|
|
use crate::helper::*;
|
|
|
|
use flowy_sys::prelude::*;
|
|
|
|
|
|
|
|
pub async fn hello() -> String { "say hello".to_string() }
|
|
|
|
#[test]
|
|
|
|
fn test_init() {
|
|
|
|
setup_env();
|
|
|
|
|
|
|
|
let event = "1";
|
|
|
|
let modules = vec![Module::new().event(event, hello)];
|
|
|
|
|
|
|
|
init_system(modules, move || {
|
2021-06-30 15:11:27 +00:00
|
|
|
let request = SenderRequest::new(1, event).callback(|_config, response| {
|
2021-06-29 08:52:29 +00:00
|
|
|
log::info!("async resp: {:?}", response);
|
2021-06-30 15:11:27 +00:00
|
|
|
});
|
2021-06-29 08:52:29 +00:00
|
|
|
|
2021-06-30 15:11:27 +00:00
|
|
|
let resp = sync_send(request);
|
2021-06-29 08:52:29 +00:00
|
|
|
log::info!("sync resp: {:?}", resp);
|
|
|
|
stop_system();
|
|
|
|
});
|
|
|
|
}
|