mecha10-planning 0.6.3

Path planning and navigation algorithms for Mecha10 - A*, RRT, and more
use mecha10_behavior_runtime::prelude::*;
use mecha10_planning::*;

#[tokio::test]
#[ignore = "Requires Redis infrastructure"]
async fn test_path_planner_node_success() {
    let ctx = Context::new("test").await.unwrap();

    let planner = AStarPlanner::new((0.0, 0.0), (5.0, 5.0), 1.0);
    let mut node = PathPlannerNode::new(Box::new(planner));

    let status = node.tick(&ctx).await.unwrap();
    assert_eq!(status, NodeStatus::Success);
    assert!(node.path().is_some());
}

#[tokio::test]
#[ignore = "Requires Redis infrastructure"]
async fn test_path_planner_node_caching() {
    let ctx = Context::new("test").await.unwrap();

    let planner = AStarPlanner::new((0.0, 0.0), (5.0, 5.0), 1.0);
    let mut node = PathPlannerNode::new(Box::new(planner));

    let status1 = node.tick(&ctx).await.unwrap();
    assert_eq!(status1, NodeStatus::Success);

    let status2 = node.tick(&ctx).await.unwrap();
    assert_eq!(status2, NodeStatus::Success);
}