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

Function test_turn_event_serde_roundtrip

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

Source from the content-addressed store, hash-verified

1318
1319 #[test]
1320 fn test_turn_event_serde_roundtrip() {
1321 let event = TurnEvent::new("sess-1", HookType::TurnStart)
1322 .with_prompt("hello")
1323 .with_transcript_path("/tmp/t.jsonl");
1324
1325 let json = serde_json::to_string(&event).unwrap();
1326 let parsed: TurnEvent = serde_json::from_str(&json).unwrap();
1327
1328 assert_eq!(parsed.session_id, event.session_id);
1329 assert_eq!(parsed.event_type, event.event_type);
1330 assert_eq!(parsed.prompt, event.prompt);
1331 assert_eq!(parsed.transcript_path, event.transcript_path);
1332 }
1333
1334 #[test]
1335 fn test_turn_event_serde_skips_none_fields() {

Callers

nothing calls this directly

Calls 3

with_transcript_pathMethod · 0.80
with_promptMethod · 0.80
unwrapMethod · 0.45

Tested by

no test coverage detected