MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / test_full_lifecycle_multi_turn

Function test_full_lifecycle_multi_turn

atomic-agent/src/turn/phase.rs:1118–1141  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1116
1117 #[test]
1118 fn test_full_lifecycle_multi_turn() {
1119 let ctx = TransitionContext::default();
1120
1121 // Turn 1
1122 let r = transition(Phase::Idle, Event::TurnStart, ctx);
1123 assert_eq!(r.new_phase, Phase::Active);
1124 let r = transition(Phase::Active, Event::TurnEnd, ctx);
1125 assert_eq!(r.new_phase, Phase::Idle);
1126 assert!(r.requires_recording());
1127
1128 // Turn 2
1129 let r = transition(Phase::Idle, Event::TurnStart, ctx);
1130 assert_eq!(r.new_phase, Phase::Active);
1131 let r = transition(Phase::Active, Event::TurnEnd, ctx);
1132 assert_eq!(r.new_phase, Phase::Idle);
1133 assert!(r.requires_recording());
1134
1135 // Turn 3
1136 let r = transition(Phase::Idle, Event::TurnStart, ctx);
1137 assert_eq!(r.new_phase, Phase::Active);
1138 let r = transition(Phase::Active, Event::TurnEnd, ctx);
1139 assert_eq!(r.new_phase, Phase::Idle);
1140 assert!(r.requires_recording());
1141 }
1142
1143 #[test]
1144 fn test_full_lifecycle_mid_turn_record() {

Callers

nothing calls this directly

Calls 1

transitionFunction · 0.85

Tested by

no test coverage detected