()
| 375 | |
| 376 | #[test] |
| 377 | fn test_matcher_serialization() { |
| 378 | let matcher = HookMatcher::tool("Bash").with_command("rm.*"); |
| 379 | |
| 380 | let json = serde_json::to_string(&matcher).unwrap(); |
| 381 | assert!(json.contains("Bash")); |
| 382 | assert!(json.contains("rm.*")); |
| 383 | |
| 384 | let parsed: HookMatcher = serde_json::from_str(&json).unwrap(); |
| 385 | assert_eq!(parsed.tool, Some("Bash".to_string())); |
| 386 | assert_eq!(parsed.command_pattern, Some("rm.*".to_string())); |
| 387 | } |
| 388 | |
| 389 | #[test] |
| 390 | fn test_path_with_alternative_field() { |
nothing calls this directly
no test coverage detected