1 mod test_sleep; 2 3 use crate::time::{self, Instant}; 4 use std::time::Duration; 5 assert_send<T: Send>()6fn assert_send<T: Send>() {} assert_sync<T: Sync>()7fn assert_sync<T: Sync>() {} 8 9 #[test] registration_is_send_and_sync()10fn registration_is_send_and_sync() { 11 use crate::time::Sleep; 12 13 assert_send::<Sleep>(); 14 assert_sync::<Sleep>(); 15 } 16 17 #[test] 18 #[should_panic] sleep_is_eager()19fn sleep_is_eager() { 20 let when = Instant::now() + Duration::from_millis(100); 21 let _ = time::sleep_until(when); 22 } 23