MCPcopy Create free account
hub / github.com/AI45Lab/Code / test_hook_matches_with_matcher

Function test_hook_matches_with_matcher

core/src/hooks/engine.rs:476–485  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

474
475 #[test]
476 fn test_hook_matches_with_matcher() {
477 let hook = Hook::new("test-hook", HookEventType::PreToolUse)
478 .with_matcher(HookMatcher::tool("Bash"));
479
480 let bash_event = make_pre_tool_event("s1", "Bash");
481 let read_event = make_pre_tool_event("s1", "Read");
482
483 assert!(hook.matches(&bash_event));
484 assert!(!hook.matches(&read_event));
485 }
486
487 #[test]
488 fn test_hook_result_constructors() {

Callers

nothing calls this directly

Calls 2

with_matcherMethod · 0.80
make_pre_tool_eventFunction · 0.70

Tested by

no test coverage detected