()
| 796 | |
| 797 | #[test] |
| 798 | fn test_parse_before_tool() { |
| 799 | let hook = make_hook(); |
| 800 | let input = br#"{ |
| 801 | "session_id": "s1", |
| 802 | "tool_name": "edit", |
| 803 | "tool_call_id": "call-42", |
| 804 | "tool_input": {"filePath": "src/main.rs"} |
| 805 | }"#; |
| 806 | let event = hook.parse_event(HookType::PreToolUse, input).unwrap(); |
| 807 | assert_eq!(event.session_id, "s1"); |
| 808 | assert_eq!(event.event_type, HookType::PreToolUse); |
| 809 | assert_eq!(event.tool_name.as_deref(), Some("edit")); |
| 810 | assert_eq!(event.tool_use_id.as_deref(), Some("call-42")); |
| 811 | } |
| 812 | |
| 813 | #[test] |
| 814 | fn test_parse_before_tool_minimal() { |
nothing calls this directly
no test coverage detected