()
| 323 | |
| 324 | #[test] |
| 325 | fn test_command_pattern_matcher() { |
| 326 | let matcher = HookMatcher::command(r"rm\s+-rf"); |
| 327 | |
| 328 | let rm_event = make_pre_tool_event( |
| 329 | "s1", |
| 330 | "Bash", |
| 331 | serde_json::json!({"command": "rm -rf /tmp/test"}), |
| 332 | ); |
| 333 | let echo_event = |
| 334 | make_pre_tool_event("s1", "Bash", serde_json::json!({"command": "echo hello"})); |
| 335 | |
| 336 | assert!(matcher.matches(&rm_event)); |
| 337 | assert!(!matcher.matches(&echo_event)); |
| 338 | } |
| 339 | |
| 340 | #[test] |
| 341 | fn test_combined_matchers() { |
nothing calls this directly
no test coverage detected