This commit is contained in:
nora 2024-06-27 19:44:59 +02:00
parent 9bab547bcf
commit 8c59c7b3ae
28 changed files with 233 additions and 1306 deletions

View file

@ -0,0 +1,23 @@
use async_experiments::Executor;
#[test]
fn execute() {
let executor = Executor::new();
executor.block_on(async {});
executor.block_on(async {});
}
#[test]
fn join2() {
let exec = Executor::new();
let r = exec.block_on(async {
let t1 = async_experiments::spawn_blocking(|| 1);
let t2 = async_experiments::spawn_blocking(|| 2);
let (r1, r2) = async_experiments::join2(t1, t2).await;
r1 + r2
});
assert_eq!(r, 3)
}