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

Function phases_get_monotonic_indices

core/src/orchestration/workflow.rs:431–447  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

429
430 #[tokio::test]
431 async fn phases_get_monotonic_indices() {
432 let wf = Workflow::builder(Arc::new(EchoExecutor::new())).build();
433 let mut rx = wf.subscribe();
434 wf.phase("one", vec![spec("a", "explore", "p")]).await;
435 wf.phase("two", vec![spec("b", "explore", "p")]).await;
436
437 let indices: Vec<usize> = {
438 let mut seen = Vec::new();
439 while let Ok(ev) = rx.try_recv() {
440 if let WorkflowEvent::PhaseStart { index, .. } = ev {
441 seen.push(index);
442 }
443 }
444 seen
445 };
446 assert_eq!(indices, vec![0, 1], "phase indices increment per call");
447 }
448
449 #[tokio::test]
450 async fn phase_with_store_resumes_from_checkpoint() {

Callers

nothing calls this directly

Calls 3

phaseMethod · 0.80
buildMethod · 0.45
subscribeMethod · 0.45

Tested by

no test coverage detected