()
| 851 | |
| 852 | #[test] |
| 853 | fn test_parse_after_tool() { |
| 854 | let hook = make_hook(); |
| 855 | let input = br#"{ |
| 856 | "session_id": "s1", |
| 857 | "tool_name": "bash", |
| 858 | "tool_call_id": "call-99", |
| 859 | "status": "completed", |
| 860 | "duration": 1500, |
| 861 | "modified_files": true |
| 862 | }"#; |
| 863 | let event = hook.parse_event(HookType::PostToolUse, input).unwrap(); |
| 864 | assert_eq!(event.session_id, "s1"); |
| 865 | assert_eq!(event.event_type, HookType::PostToolUse); |
| 866 | assert_eq!(event.tool_name.as_deref(), Some("bash")); |
| 867 | assert_eq!(event.tool_use_id.as_deref(), Some("call-99")); |
| 868 | } |
| 869 | |
| 870 | // parse_event tests: error cases |
| 871 |
nothing calls this directly
no test coverage detected