1
0
mirror of https://github.com/fafhrd91/actix-net synced 2025-06-26 19:47:43 +02:00

express spawn fn as spawn fut (#256)

This commit is contained in:
Rob Ede
2021-01-29 15:16:30 +00:00
committed by GitHub
parent 2924419905
commit 1b35ff8ee6
8 changed files with 130 additions and 111 deletions

View File

@ -136,12 +136,10 @@ fn worker_drop_no_panic_fn() {
#[test]
fn worker_drop_no_panic_fut() {
use futures_util::future::lazy;
let _ = System::new("test-system");
let mut worker = Worker::new();
worker.spawn(lazy(|_| panic!("test")));
worker.spawn(async { panic!("test") });
worker.stop();
worker.join().unwrap();
@ -187,3 +185,15 @@ fn system_name_cow_string() {
let _ = System::new("test-system".to_owned());
System::current().stop();
}
#[test]
#[should_panic]
fn no_system_current_panic() {
System::current();
}
#[test]
#[should_panic]
fn no_system_worker_new_panic() {
Worker::new();
}