Files
tokio/tokio-signal/tests/twice.rs
T

20 lines
490 B
Rust
Raw Normal View History

#![cfg(unix)]
extern crate libc;
2018-07-28 12:30:46 -07:00
pub mod support;
use support::*;
#[test]
fn twice() {
2018-09-02 11:32:50 +02:00
let mut rt = CurrentThreadRuntime::new().unwrap();
let signal = run_with_timeout(&mut rt, Signal::new(libc::SIGUSR1)).unwrap();
2018-07-28 12:30:46 -07:00
send_signal(libc::SIGUSR1);
2018-09-02 11:32:50 +02:00
let (num, signal) = run_with_timeout(&mut rt, signal.into_future()).ok().unwrap();
assert_eq!(num, Some(libc::SIGUSR1));
2018-07-28 12:30:46 -07:00
send_signal(libc::SIGUSR1);
2018-09-02 11:32:50 +02:00
run_with_timeout(&mut rt, signal.into_future()).ok().unwrap();
}