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

Source from the content-addressed store, hash-verified

936
937 #[test]
938 fn test_turn_event_serde_roundtrip() {
939 let event = TurnEvent::new("sess-1", HookType::TurnStart)
940 .with_prompt("hello")
941 .with_transcript_path("/tmp/t.jsonl");
942
943 let json = serde_json::to_string(&event).unwrap();
944 let parsed: TurnEvent = serde_json::from_str(&json).unwrap();
945
946 assert_eq!(parsed.session_id, event.session_id);
947 assert_eq!(parsed.event_type, event.event_type);
948 assert_eq!(parsed.prompt, event.prompt);
949 assert_eq!(parsed.transcript_path, event.transcript_path);
950 }
951
952 #[test]
953 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