Dever v0.0.2

This commit is contained in:
Codex committed 2026-11-27 06:03:56 +00:00
commit e6e175ebcf
816 files changed
+120349

No files matched your search

+25
View File
@@ -0,0 +1,25 @@
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 { .. })));