()
| 824 | |
| 825 | #[test] |
| 826 | fn test_parse_before_tool() { |
| 827 | let hook = make_hook(); |
| 828 | let input = br#"{ |
| 829 | "session_id": "s1", |
| 830 | "tool_name": "edit", |
| 831 | "tool_call_id": "call-42", |
| 832 | "tool_input": {"filePath": "src/main.rs"} |
| 833 | }"#; |
| 834 | let event = hook.parse_event(HookType::PreToolUse, input).unwrap(); |
| 835 | assert_eq!(event.session_id, "s1"); |
| 836 | assert_eq!(event.event_type, HookType::PreToolUse); |
| 837 | assert_eq!(event.tool_name.as_deref(), Some("edit")); |
| 838 | assert_eq!(event.tool_use_id.as_deref(), Some("call-42")); |
| 839 | } |
| 840 | |
| 841 | #[test] |
| 842 | fn test_parse_before_tool_minimal() { |
nothing calls this directly
no test coverage detected