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

Function test_get_ready_steps_wave

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

Source from the content-addressed store, hash-verified

621
622 #[test]
623 fn test_get_ready_steps_wave() {
624 // s1 and s2 are independent; s3 depends on both
625 let mut plan = ExecutionPlan::new("Test", Complexity::Medium);
626 plan.add_step(Task::new("s1", "Step 1"));
627 plan.add_step(Task::new("s2", "Step 2"));
628 plan.add_step(
629 Task::new("s3", "Step 3").with_dependencies(vec!["s1".to_string(), "s2".to_string()]),
630 );
631
632 // Wave 1: s1 and s2
633 let ready = plan.get_ready_steps();
634 assert_eq!(ready.len(), 2);
635 let ids: Vec<&str> = ready.iter().map(|s| s.id.as_str()).collect();
636 assert!(ids.contains(&"s1"));
637 assert!(ids.contains(&"s2"));
638
639 // Complete wave 1
640 plan.mark_status("s1", TaskStatus::Completed);
641 plan.mark_status("s2", TaskStatus::Completed);
642
643 // Wave 2: s3
644 let ready = plan.get_ready_steps();
645 assert_eq!(ready.len(), 1);
646 assert_eq!(ready[0].id, "s3");
647 }
648
649 // ========================================================================
650 // AgentGoal tests

Callers

nothing calls this directly

Calls 5

add_stepMethod · 0.80
with_dependenciesMethod · 0.80
get_ready_stepsMethod · 0.80
mark_statusMethod · 0.80
as_strMethod · 0.45

Tested by

no test coverage detected