use super::*; #[tokio::test] async fn async_test_u8_transfer() { let receiver: Access>, Suspending> = Default::default(); let sender: Access>, Blocking> = Arc::clone(&receiver).into(); let handle = thread::spawn(move || { thread::sleep(Duration::from_millis(400u64)); let _: () = sender.publish(42u8); }); assert_eq!(receiver.result().await.unwrap().take(), Some(42u8)); assert!(!receiver.edit().await.unwrap().has()); await_completion_non_blocking(handle).await } #[tokio::test] async fn async_test_u8_retrieval() { let instant_receiver: Access>, Instantly> = Default::default(); let suspending_receiver: Access<&Rusturn, _> = instant_receiver.suspending_access(); let sender: Access>, Instantly> = Arc::clone(&instant_receiver).into(); let handle = thread::spawn(move || { thread::sleep(Duration::from_millis(400u64)); let _: () = sender.try_publish(34u8).unwrap(); }); assert_eq!(suspending_receiver.receive().await.unwrap(), 34u8); assert!(instant_receiver.try_take().unwrap().is_none()); await_completion_non_blocking(handle).await }