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:1321–1333  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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