Files
tokio/tokio-net/tests/signal_twice.rs
T

22 lines
438 B
Rust
Raw Normal View History

#![cfg(unix)]
2019-08-17 13:43:55 -07:00
#![cfg(feature = "signal")]
#![warn(rust_2018_idioms)]
mod support;
use support::*;
2019-07-03 10:40:59 -07:00
#[tokio::test]
async fn twice() {
2019-08-15 21:09:09 -07:00
let kind = SignalKind::user_defined1();
let mut sig = signal(kind).expect("failed to get signal");
2018-07-28 12:30:46 -07:00
2019-07-03 10:40:59 -07:00
for _ in 0..2 {
send_signal(libc::SIGUSR1);
2018-07-28 12:30:46 -07:00
let (item, sig_next) = with_timeout(sig.into_future()).await;
assert_eq!(item, Some(()));
2019-07-03 10:40:59 -07:00
sig = sig_next;
2019-07-03 10:40:59 -07:00
}
}