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

Source from the content-addressed store, hash-verified

928
929 #[test]
930 fn test_turn_event_serde_roundtrip() {
931 let event = TurnEvent::new("sess-1", HookType::TurnStart)
932 .with_prompt("hello")
933 .with_transcript_path("/tmp/t.jsonl");
934
935 let json = serde_json::to_string(&event).unwrap();
936 let parsed: TurnEvent = serde_json::from_str(&json).unwrap();
937
938 assert_eq!(parsed.session_id, event.session_id);
939 assert_eq!(parsed.event_type, event.event_type);
940 assert_eq!(parsed.prompt, event.prompt);
941 assert_eq!(parsed.transcript_path, event.transcript_path);
942 }
943
944 #[test]
945 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