()
| 659 | |
| 660 | #[test] |
| 661 | fn test_hook_serialization() { |
| 662 | let hook = Hook::new("test-hook", HookEventType::PreToolUse) |
| 663 | .with_matcher(HookMatcher::tool("Bash")) |
| 664 | .with_config(HookConfig { |
| 665 | priority: 50, |
| 666 | timeout_ms: 5000, |
| 667 | async_execution: true, |
| 668 | max_retries: 3, |
| 669 | }); |
| 670 | |
| 671 | let json = serde_json::to_string(&hook).unwrap(); |
| 672 | assert!(json.contains("test-hook")); |
| 673 | assert!(json.contains("pre_tool_use")); |
| 674 | assert!(json.contains("Bash")); |
| 675 | |
| 676 | let parsed: Hook = serde_json::from_str(&json).unwrap(); |
| 677 | assert_eq!(parsed.id, "test-hook"); |
| 678 | assert_eq!(parsed.event_type, HookEventType::PreToolUse); |
| 679 | assert_eq!(parsed.config.priority, 50); |
| 680 | } |
| 681 | |
| 682 | #[test] |
| 683 | fn test_all_hooks() { |
nothing calls this directly
no test coverage detected