use ump::{channel, Error}; #[test] fn sync_expect_err_if_server_dropped() { let (server, client) = channel::(); // nuke the only client drop(client); let Err(Error::ClientsDisappeared) = server.wait() else { panic!("Unexpected error"); }; } #[test] fn async_expect_err_if_server_dropped() { let tokrt = tokio::runtime::Runtime::new().unwrap(); let (server, client) = channel::(); // nuke the only client drop(client); tokrt.block_on(async { let Err(Error::ClientsDisappeared) = server.async_wait().await else { panic!("Unexpected error"); }; }); } // vim: set ft=rust et sw=2 ts=2 sts=2 cinoptions=2 tw=79 :