use procsem::ProcSem; #[test] fn endmsg() { let procsem = ProcSem::new(); let Some(pctx) = procsem.try_acquire() else { panic!("Unable to acquire process semaphore"); }; pctx.end("final"); drop(pctx); // // Should be "final" // assert_eq!(procsem.endmsg(), Some(String::from("final"))); let Some(_pctx) = procsem.try_acquire() else { panic!("Unable to acquire process semaphore"); }; // // Should be reset // assert_eq!(procsem.endmsg(), None); } // vim: set ft=rust et sw=2 ts=2 sts=2 cinoptions=2 tw=79 :