()
| 528 | |
| 529 | #[test] |
| 530 | fn test_execution_plan() { |
| 531 | let mut plan = ExecutionPlan::new("Test goal", Complexity::Medium); |
| 532 | |
| 533 | plan.add_step(Task::new("step-1", "First step")); |
| 534 | plan.add_step( |
| 535 | Task::new("step-2", "Second step").with_dependencies(vec!["step-1".to_string()]), |
| 536 | ); |
| 537 | |
| 538 | assert_eq!(plan.steps.len(), 2); |
| 539 | assert_eq!(plan.estimated_steps, 2); |
| 540 | assert_eq!(plan.progress(), 0.0); |
| 541 | |
| 542 | // Mark first step as completed |
| 543 | plan.steps[0].status = TaskStatus::Completed; |
| 544 | assert_eq!(plan.progress(), 0.5); |
| 545 | |
| 546 | // Check ready steps |
| 547 | let ready = plan.get_ready_steps(); |
| 548 | assert_eq!(ready.len(), 1); |
| 549 | assert_eq!(ready[0].id, "step-2"); |
| 550 | } |
| 551 | |
| 552 | // ======================================================================== |
| 553 | // ExecutionPlan helper method tests |
nothing calls this directly
no test coverage detected