module.rs 392 B

123456789101112131415
  1. use crate::helper::*;
  2. use flowy_sys::prelude::*;
  3. pub async fn hello() -> String { "say hello".to_string() }
  4. #[tokio::test]
  5. async fn test_init() {
  6. setup_env();
  7. let event = "1";
  8. init_system(|| vec![Module::new().event(event, hello)]);
  9. let request = DispatchRequest::new(1, event);
  10. let resp = async_send(request).await.unwrap();
  11. log::info!("sync resp: {:?}", resp);
  12. }