26 lines
978 B
Plaintext
26 lines
978 B
Plaintext
use dever_runtime::task;
|
|
task::run(true, 8, async |scope| {
|
|
assert_eq!(@timed@(scope).await?, 42);
|
|
assert_eq!(@fast@(scope).await, 7);
|
|
assert_eq!(@racing@(scope).await?, 42);
|
|
assert_eq!(@ordered@(scope).await?, 42);
|
|
assert!([41, 42].contains(&@multiple@(scope).await));
|
|
assert_eq!(@multiTimeout@(scope).await, 41);
|
|
@grouped@(scope).await?;
|
|
@stopped@(scope).await?;
|
|
assert_eq!(@capturedRace@(scope).await, -1);
|
|
assert_eq!(@capturedTimeout@(scope).await, -1);
|
|
@capturedGroup@(scope).await?;
|
|
assert_eq!(@boundFallback@(scope).await?, 42);
|
|
@parallelGroups@(scope).await;
|
|
Ok::<_, Failure>(())
|
|
}).unwrap().unwrap();
|
|
|
|
task::run(true, 1, async |scope| {
|
|
assert_eq!(@capturedFallback@(scope).await, -1);
|
|
assert_eq!(@capturedFallback@(scope).await, -1);
|
|
Ok::<_, ()>(())
|
|
}).unwrap().unwrap();
|
|
|
|
assert!(matches!(task::run(true, 1, async |scope| @neverGroup@(scope).await).unwrap(), Err(task::RunError::Business { .. })));
|