mod common; use common::{Put, Reply, Request, ThreadedServer}; // Check the signalled state, which should be false. // Then Signal. // And finally check signalled state again, which should be true. #[test] fn no_clients() { let (clnt, jh) = ump_ng_server::spawn_thread(|_clnt| Ok(ThreadedServer::default())) .unwrap(); let reply = clnt.req(Request::GetSignalState).unwrap(); assert_eq!(reply, Reply::SignalState(false)); clnt.post(Put::Signal).unwrap(); let reply = clnt.req(Request::GetSignalState).unwrap(); assert_eq!(reply, Reply::SignalState(true)); clnt.post(Put::Croak).unwrap(); assert_eq!(jh.join().unwrap(), Some(42)); } // vim: set ft=rust et sw=2 ts=2 sts=2 cinoptions=2 tw=79 :