()
| 597 | |
| 598 | #[test] |
| 599 | fn test_parse_pre_tool_use() { |
| 600 | let hook = make_hook(); |
| 601 | let input = br#"{ |
| 602 | "sessionId": "s1", |
| 603 | "toolName": "run_terminal_command", |
| 604 | "toolUseId": "tu-1", |
| 605 | "toolInput": {"command": "cargo test"}, |
| 606 | "cwd": "/repo" |
| 607 | }"#; |
| 608 | let event = hook.parse_event(HookType::PreToolUse, input).unwrap(); |
| 609 | assert_eq!(event.tool_name.as_deref(), Some("run_terminal_command")); |
| 610 | assert_eq!(event.tool_use_id.as_deref(), Some("tu-1")); |
| 611 | } |
| 612 | |
| 613 | #[test] |
| 614 | fn test_parse_post_tool_use() { |
nothing calls this directly
no test coverage detected