Update tests, examples, benches

This commit is contained in:
TechnoPorg committed 2026-01-22 00:30:48 +01:00
1 parent bacac903b3
commit 85ccd7e507
89 files changed
+942 -1785

No files matched your search

+5 -16
View File
@@ -2,6 +2,7 @@
use crate::common::task_fn;
use dagx::{DagResult, DagRunner};
use futures::FutureExt;
#[tokio::test]
async fn test_2d_grid_pattern() -> DagResult<()> {
@@ -33,10 +34,7 @@ async fn test_2d_grid_pattern() -> DagResult<()> {
}
}
dag.run(|fut| {
tokio::spawn(fut);
})
.await?;
dag.run(|fut| tokio::spawn(fut).map(Result::unwrap)).await?;
// Check corner values
let bottom_right = dag.get(grid[3][3].as_ref().unwrap())?;
@@ -99,10 +97,7 @@ async fn test_3d_grid_pattern() -> DagResult<()> {
}
}
dag.run(|fut| {
tokio::spawn(fut);
})
.await?;
dag.run(|fut| tokio::spawn(fut).map(Result::unwrap)).await?;
// Check that all cells have values
for row in &grid {
@@ -178,10 +173,7 @@ async fn test_hexagonal_grid() -> DagResult<()> {
hex_grid.insert((q, r), task);
}
dag.run(|fut| {
tokio::spawn(fut);
})
.await?;
dag.run(|fut| tokio::spawn(fut).map(Result::unwrap)).await?;
// Verify center and some ring values
assert_eq!(dag.get(hex_grid.get(&(0, 0)).unwrap())?, 100);
@@ -230,10 +222,7 @@ async fn test_toroidal_grid() -> DagResult<()> {
}
}
dag.run(|fut| {
tokio::spawn(fut);
})
.await?;
dag.run(|fut| tokio::spawn(fut).map(Result::unwrap)).await?;
// Verify all torus tasks completed
for task in torus_tasks {