()
| 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() { |
nothing calls this directly
no test coverage detected