Sha256: 9b53065781b37f3db5f7c67938239b0f3b0ebbc5938c14a5b730ad7ec07415d2
Contents?: true
Size: 640 Bytes
Versions: 34
Compression:
Stored size: 640 Bytes
Contents
#![warn(rust_2018_idioms)] #![cfg(feature = "full")] #![cfg(unix)] mod support { pub mod signal; } use support::signal::send_signal; use tokio::signal; use tokio::sync::oneshot; use tokio_test::assert_ok; #[tokio::test] async fn ctrl_c() { let ctrl_c = signal::ctrl_c(); let (fire, wait) = oneshot::channel(); // NB: simulate a signal coming in by exercising our signal handler // to avoid complications with sending SIGINT to the test process tokio::spawn(async { wait.await.expect("wait failed"); send_signal(libc::SIGINT); }); let _ = fire.send(()); assert_ok!(ctrl_c.await); }
Version data entries
34 entries across 34 versions & 1 rubygems