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

Function test_turn_event_builder_chain

atomic-agent/src/event.rs:1214–1230  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1212
1213 #[test]
1214 fn test_turn_event_builder_chain() {
1215 let event = TurnEvent::new("sess-1", HookType::TurnStart)
1216 .with_prompt("Fix the bug")
1217 .with_transcript_path("/tmp/transcript.jsonl")
1218 .with_tool_name("Edit")
1219 .with_tool_use_id("tu-123")
1220 .with_raw_json(serde_json::json!({"session_id": "sess-1"}));
1221
1222 assert_eq!(event.prompt.as_deref(), Some("Fix the bug"));
1223 assert_eq!(
1224 event.transcript_path.as_deref(),
1225 Some(std::path::Path::new("/tmp/transcript.jsonl"))
1226 );
1227 assert_eq!(event.tool_name.as_deref(), Some("Edit"));
1228 assert_eq!(event.tool_use_id.as_deref(), Some("tu-123"));
1229 assert!(event.raw_json.is_some());
1230 }
1231
1232 #[test]
1233 fn test_turn_event_has_prompt() {

Callers

nothing calls this directly

Calls 5

with_raw_jsonMethod · 0.80
with_tool_use_idMethod · 0.80
with_transcript_pathMethod · 0.80
with_promptMethod · 0.80
with_tool_nameMethod · 0.45

Tested by

no test coverage detected