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