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

Function test_path_pattern_matcher

core/src/hooks/matcher.rs:287–303  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

285
286 #[test]
287 fn test_path_pattern_matcher() {
288 let matcher = HookMatcher::path("*.rs");
289
290 let rs_event = make_pre_tool_event(
291 "s1",
292 "Write",
293 serde_json::json!({"file_path": "src/main.rs"}),
294 );
295 let py_event = make_pre_tool_event(
296 "s1",
297 "Write",
298 serde_json::json!({"file_path": "src/main.py"}),
299 );
300
301 assert!(matcher.matches(&rs_event));
302 assert!(!matcher.matches(&py_event));
303 }
304
305 #[test]
306 fn test_path_pattern_double_star() {

Callers

nothing calls this directly

Calls 1

make_pre_tool_eventFunction · 0.70

Tested by

no test coverage detected