MCPcopy Create free account
hub / github.com/AI45Lab/Code / test_execution_plan

Function test_execution_plan

core/src/planning/mod.rs:530–550  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

add_stepMethod · 0.80
with_dependenciesMethod · 0.80
get_ready_stepsMethod · 0.80

Tested by

no test coverage detected