()
| 655 | |
| 656 | #[test] |
| 657 | fn test_parse_pre_tool_use() { |
| 658 | let hook = make_hook(); |
| 659 | let input = br#"{ |
| 660 | "sessionId": "s1", |
| 661 | "toolName": "run_terminal_command", |
| 662 | "toolUseId": "tu-1", |
| 663 | "toolInput": {"command": "cargo test"}, |
| 664 | "cwd": "/repo" |
| 665 | }"#; |
| 666 | let event = hook.parse_event(HookType::PreToolUse, input).unwrap(); |
| 667 | assert_eq!(event.tool_name.as_deref(), Some("run_terminal_command")); |
| 668 | assert_eq!(event.tool_use_id.as_deref(), Some("tu-1")); |
| 669 | } |
| 670 | |
| 671 | #[test] |
| 672 | fn test_parse_post_tool_use() { |
nothing calls this directly
no test coverage detected