()
| 665 | |
| 666 | #[test] |
| 667 | fn test_parse_pre_tool() { |
| 668 | let hook = make_hook(); |
| 669 | let input = br#"{ |
| 670 | "session_id": "s1", |
| 671 | "toolName": "edit", |
| 672 | "toolArgs": {"filePath": "src/main.rs"}, |
| 673 | "tool_use_id": "call-42" |
| 674 | }"#; |
| 675 | let event = hook.parse_event(HookType::PreToolUse, input).unwrap(); |
| 676 | assert_eq!(event.session_id, "s1"); |
| 677 | assert_eq!(event.event_type, HookType::PreToolUse); |
| 678 | assert_eq!(event.tool_name.as_deref(), Some("edit")); |
| 679 | assert_eq!(event.tool_use_id.as_deref(), Some("call-42")); |
| 680 | } |
| 681 | |
| 682 | #[test] |
| 683 | fn test_parse_pre_tool_snake_case() { |
nothing calls this directly
no test coverage detected