()
| 914 | |
| 915 | #[test] |
| 916 | fn test_parse_before_tool() { |
| 917 | let hook = make_hook(); |
| 918 | let input = br#"{ |
| 919 | "session_id": "s1", |
| 920 | "tool_name": "edit", |
| 921 | "tool_call_id": "call-42", |
| 922 | "tool_input": {"filePath": "src/main.rs"} |
| 923 | }"#; |
| 924 | let event = hook.parse_event(HookType::PreToolUse, input).unwrap(); |
| 925 | assert_eq!(event.session_id, "s1"); |
| 926 | assert_eq!(event.event_type, HookType::PreToolUse); |
| 927 | assert_eq!(event.tool_name.as_deref(), Some("edit")); |
| 928 | assert_eq!(event.tool_use_id.as_deref(), Some("call-42")); |
| 929 | } |
| 930 | |
| 931 | #[test] |
| 932 | fn test_parse_before_tool_minimal() { |
nothing calls this directly
no test coverage detected