()
| 1027 | |
| 1028 | #[test] |
| 1029 | fn test_parse_session_end() { |
| 1030 | let input = br#"{ |
| 1031 | "session_id": "sess-123", |
| 1032 | "transcript_path": "/tmp/codex.jsonl", |
| 1033 | "cwd": "/repo", |
| 1034 | "hook_event_name": "SessionEnd", |
| 1035 | "reason": "other" |
| 1036 | }"#; |
| 1037 | let event = make_hook() |
| 1038 | .parse_event(HookType::SessionEnd, input) |
| 1039 | .unwrap(); |
| 1040 | assert_eq!(event.session_id, "sess-123"); |
| 1041 | assert_eq!(event.event_type, HookType::SessionEnd); |
| 1042 | assert_eq!( |
| 1043 | event.transcript_path.as_deref(), |
| 1044 | Some(Path::new("/tmp/codex.jsonl")) |
| 1045 | ); |
| 1046 | let raw = event.raw_json.unwrap(); |
| 1047 | assert_eq!(raw["reason"], "other"); |
| 1048 | assert_eq!(raw["provider"], "openai"); |
| 1049 | } |
| 1050 | |
| 1051 | #[test] |
| 1052 | fn test_parse_event_empty_input() { |
nothing calls this directly
no test coverage detected