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

add System::try_current (#275)

This commit is contained in:
Rob Ede
2021-02-06 22:45:03 +00:00
committed by GitHub
parent eb4d29e15e
commit 32543809f9
3 changed files with 21 additions and 0 deletions

View File

@ -288,3 +288,13 @@ fn new_arbiter_with_tokio() {
assert_eq!(false, counter.load(Ordering::SeqCst));
}
#[test]
fn try_current_no_system() {
assert!(System::try_current().is_none())
}
#[test]
fn try_current_with_system() {
System::new().block_on(async { assert!(System::try_current().is_some()) });
}