#[cfg(test)] mod tests { use bytes::Bytes; #[tokio::test(flavor = "multi_thread", worker_threads = 1)] async fn create_global() { let addr = "[::1]:50051"; dstore::Global::start_server(addr.parse().unwrap()).await.unwrap(); if let Ok(l1) = dstore::Local::new(addr.to_string(), "[::1]:50052".to_string()).await { if let Ok(l2) = dstore::Local::new(addr.to_string(), "[::1]:50053".to_string()).await { l1.lock().await.insert_single(Bytes::from("Hello"), Bytes::from("World")).await.unwrap(); let res = l2.lock().await.get_single(&Bytes::from("Hello")).await.unwrap(); assert_eq!(res, Bytes::from("World")); } } } }