()
| 696 | |
| 697 | #[test] |
| 698 | fn test_parse_post_tool() { |
| 699 | let hook = make_hook(); |
| 700 | let input = br#"{ |
| 701 | "session_id": "s1", |
| 702 | "toolName": "bash", |
| 703 | "toolArgs": {"command": "ls -la"}, |
| 704 | "tool_use_id": "call-99", |
| 705 | "toolResponse": {"exitCode": 0}, |
| 706 | "duration": 1500 |
| 707 | }"#; |
| 708 | let event = hook.parse_event(HookType::PostToolUse, input).unwrap(); |
| 709 | assert_eq!(event.session_id, "s1"); |
| 710 | assert_eq!(event.event_type, HookType::PostToolUse); |
| 711 | assert_eq!(event.tool_name.as_deref(), Some("bash")); |
| 712 | assert_eq!(event.tool_use_id.as_deref(), Some("call-99")); |
| 713 | } |
| 714 | |
| 715 | #[test] |
| 716 | fn test_parse_post_tool_snake_case_fields() { |
nothing calls this directly
no test coverage detected