()
| 784 | |
| 785 | #[test] |
| 786 | fn test_parse_pre_tool() { |
| 787 | let hook = make_hook(); |
| 788 | let input = br#"{ |
| 789 | "taskId": "tool-1", |
| 790 | "hookName": "PreToolUse", |
| 791 | "preToolUse": { |
| 792 | "tool": "write_to_file", |
| 793 | "parameters": {"path": "src/main.rs", "content": "fn main() {}"} |
| 794 | } |
| 795 | }"#; |
| 796 | let event = hook.parse_event(HookType::PreToolUse, input).unwrap(); |
| 797 | assert_eq!(event.session_id, "tool-1"); |
| 798 | assert_eq!(event.event_type, HookType::PreToolUse); |
| 799 | assert_eq!(event.tool_name.as_deref(), Some("write_to_file")); |
| 800 | } |
| 801 | |
| 802 | #[test] |
| 803 | fn test_parse_pre_tool_snake_case_alias() { |
nothing calls this directly
no test coverage detected