// Tests for mecha10_cli::sim::profile

use mecha10_cli::sim::profile::*;

#[test]
fn test_extract_tags_delivery() {
    let tags = extract_tags_from_node("task_planner_node", "Task planning and delivery workflow management");

    assert!(tags.contains(&"task".to_string()));
    assert!(tags.contains(&"planner".to_string()));
    assert!(tags.contains(&"delivery".to_string()));
    assert!(tags.contains(&"workflow".to_string()));
}

#[test]
fn test_extract_tags_following() {
    let tags = extract_tags_from_node("follow_controller_node", "Human following with obstacle avoidance");

    assert!(tags.contains(&"following".to_string()));
    assert!(tags.contains(&"hri".to_string()));
    assert!(tags.contains(&"avoidance".to_string()));
}

#[test]
fn test_infer_capabilities() {
    let task_nodes = vec![TaskNode {
        name: "task_planner_node".to_string(),
        description: "Planning".to_string(),
        tags: vec!["planner".to_string()],
    }];

    let sensors = vec!["lidar".to_string(), "camera".to_string()];

    let caps = infer_capabilities(&task_nodes, &sensors);

    assert!(caps.contains(&"vision_navigation".to_string()));
    assert!(caps.contains(&"navigation".to_string()));
    assert!(caps.contains(&"planning".to_string()));
}
