()
| 201 | |
| 202 | #[test] |
| 203 | fn test_parse_pre_tool_use() { |
| 204 | let hook = make_hook(); |
| 205 | let input = br#"{ |
| 206 | "session_id": "sess-7", |
| 207 | "transcript_path": "/t.jsonl", |
| 208 | "tool_use_id": "tu-001", |
| 209 | "tool_input": {"description": "run tests"} |
| 210 | }"#; |
| 211 | let event = hook.parse_event(HookType::PreToolUse, input).unwrap(); |
| 212 | |
| 213 | assert_eq!(event.session_id, "sess-7"); |
| 214 | assert_eq!(event.event_type, HookType::PreToolUse); |
| 215 | assert_eq!(event.tool_use_id, Some("tu-001".to_string())); |
| 216 | // tool_name is not set from JSON input for PreToolUse (comes from matcher context) |
| 217 | assert!(event.tool_name.is_none()); |
| 218 | } |
| 219 | |
| 220 | #[test] |
| 221 | fn test_parse_pre_tool_use_minimal() { |
nothing calls this directly
no test coverage detected