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